import {
  defineComponent as Rn,
  getCurrentInstance as Tn,
  ref as pe,
  computed as Xe,
  watch as bt,
  nextTick as Dn,
  resolveComponent as _t,
  openBlock as ie,
  createElementBlock as se,
  createVNode as ye,
  unref as Te,
  withCtx as Oe,
  createElementVNode as ce,
  renderSlot as Fn,
  createTextVNode as wt,
  toDisplayString as we,
  createCommentVNode as Se,
  normalizeStyle as Un,
  Fragment as St,
  renderList as xt,
  normalizeClass as It,
} from "vue";
import {
  ElUpload as Pn,
  ElButton as Ln,
  ElProgress as At,
  ElDialog as On,
  ElMessage as kn,
} from "element-plus";
var ke =
  typeof globalThis < "u"
    ? globalThis
    : typeof window < "u"
      ? window
      : typeof global < "u"
        ? global
        : typeof self < "u"
          ? self
          : {};
function $n(d) {
  return d && d.__esModule && Object.prototype.hasOwnProperty.call(d, "default")
    ? d.default
    : d;
}
var Tt = { exports: {} };
(function (d, C) {
  (function (k) {
    d.exports = k();
  })(function (k) {
    var B = [
      "0",
      "1",
      "2",
      "3",
      "4",
      "5",
      "6",
      "7",
      "8",
      "9",
      "a",
      "b",
      "c",
      "d",
      "e",
      "f",
    ];
    function $(v, l) {
      var o = v[0],
        n = v[1],
        r = v[2],
        i = v[3];
      ((o += (((n & r) | (~n & i)) + l[0] - 680876936) | 0),
        (o = (((o << 7) | (o >>> 25)) + n) | 0),
        (i += (((o & n) | (~o & r)) + l[1] - 389564586) | 0),
        (i = (((i << 12) | (i >>> 20)) + o) | 0),
        (r += (((i & o) | (~i & n)) + l[2] + 606105819) | 0),
        (r = (((r << 17) | (r >>> 15)) + i) | 0),
        (n += (((r & i) | (~r & o)) + l[3] - 1044525330) | 0),
        (n = (((n << 22) | (n >>> 10)) + r) | 0),
        (o += (((n & r) | (~n & i)) + l[4] - 176418897) | 0),
        (o = (((o << 7) | (o >>> 25)) + n) | 0),
        (i += (((o & n) | (~o & r)) + l[5] + 1200080426) | 0),
        (i = (((i << 12) | (i >>> 20)) + o) | 0),
        (r += (((i & o) | (~i & n)) + l[6] - 1473231341) | 0),
        (r = (((r << 17) | (r >>> 15)) + i) | 0),
        (n += (((r & i) | (~r & o)) + l[7] - 45705983) | 0),
        (n = (((n << 22) | (n >>> 10)) + r) | 0),
        (o += (((n & r) | (~n & i)) + l[8] + 1770035416) | 0),
        (o = (((o << 7) | (o >>> 25)) + n) | 0),
        (i += (((o & n) | (~o & r)) + l[9] - 1958414417) | 0),
        (i = (((i << 12) | (i >>> 20)) + o) | 0),
        (r += (((i & o) | (~i & n)) + l[10] - 42063) | 0),
        (r = (((r << 17) | (r >>> 15)) + i) | 0),
        (n += (((r & i) | (~r & o)) + l[11] - 1990404162) | 0),
        (n = (((n << 22) | (n >>> 10)) + r) | 0),
        (o += (((n & r) | (~n & i)) + l[12] + 1804603682) | 0),
        (o = (((o << 7) | (o >>> 25)) + n) | 0),
        (i += (((o & n) | (~o & r)) + l[13] - 40341101) | 0),
        (i = (((i << 12) | (i >>> 20)) + o) | 0),
        (r += (((i & o) | (~i & n)) + l[14] - 1502002290) | 0),
        (r = (((r << 17) | (r >>> 15)) + i) | 0),
        (n += (((r & i) | (~r & o)) + l[15] + 1236535329) | 0),
        (n = (((n << 22) | (n >>> 10)) + r) | 0),
        (o += (((n & i) | (r & ~i)) + l[1] - 165796510) | 0),
        (o = (((o << 5) | (o >>> 27)) + n) | 0),
        (i += (((o & r) | (n & ~r)) + l[6] - 1069501632) | 0),
        (i = (((i << 9) | (i >>> 23)) + o) | 0),
        (r += (((i & n) | (o & ~n)) + l[11] + 643717713) | 0),
        (r = (((r << 14) | (r >>> 18)) + i) | 0),
        (n += (((r & o) | (i & ~o)) + l[0] - 373897302) | 0),
        (n = (((n << 20) | (n >>> 12)) + r) | 0),
        (o += (((n & i) | (r & ~i)) + l[5] - 701558691) | 0),
        (o = (((o << 5) | (o >>> 27)) + n) | 0),
        (i += (((o & r) | (n & ~r)) + l[10] + 38016083) | 0),
        (i = (((i << 9) | (i >>> 23)) + o) | 0),
        (r += (((i & n) | (o & ~n)) + l[15] - 660478335) | 0),
        (r = (((r << 14) | (r >>> 18)) + i) | 0),
        (n += (((r & o) | (i & ~o)) + l[4] - 405537848) | 0),
        (n = (((n << 20) | (n >>> 12)) + r) | 0),
        (o += (((n & i) | (r & ~i)) + l[9] + 568446438) | 0),
        (o = (((o << 5) | (o >>> 27)) + n) | 0),
        (i += (((o & r) | (n & ~r)) + l[14] - 1019803690) | 0),
        (i = (((i << 9) | (i >>> 23)) + o) | 0),
        (r += (((i & n) | (o & ~n)) + l[3] - 187363961) | 0),
        (r = (((r << 14) | (r >>> 18)) + i) | 0),
        (n += (((r & o) | (i & ~o)) + l[8] + 1163531501) | 0),
        (n = (((n << 20) | (n >>> 12)) + r) | 0),
        (o += (((n & i) | (r & ~i)) + l[13] - 1444681467) | 0),
        (o = (((o << 5) | (o >>> 27)) + n) | 0),
        (i += (((o & r) | (n & ~r)) + l[2] - 51403784) | 0),
        (i = (((i << 9) | (i >>> 23)) + o) | 0),
        (r += (((i & n) | (o & ~n)) + l[7] + 1735328473) | 0),
        (r = (((r << 14) | (r >>> 18)) + i) | 0),
        (n += (((r & o) | (i & ~o)) + l[12] - 1926607734) | 0),
        (n = (((n << 20) | (n >>> 12)) + r) | 0),
        (o += ((n ^ r ^ i) + l[5] - 378558) | 0),
        (o = (((o << 4) | (o >>> 28)) + n) | 0),
        (i += ((o ^ n ^ r) + l[8] - 2022574463) | 0),
        (i = (((i << 11) | (i >>> 21)) + o) | 0),
        (r += ((i ^ o ^ n) + l[11] + 1839030562) | 0),
        (r = (((r << 16) | (r >>> 16)) + i) | 0),
        (n += ((r ^ i ^ o) + l[14] - 35309556) | 0),
        (n = (((n << 23) | (n >>> 9)) + r) | 0),
        (o += ((n ^ r ^ i) + l[1] - 1530992060) | 0),
        (o = (((o << 4) | (o >>> 28)) + n) | 0),
        (i += ((o ^ n ^ r) + l[4] + 1272893353) | 0),
        (i = (((i << 11) | (i >>> 21)) + o) | 0),
        (r += ((i ^ o ^ n) + l[7] - 155497632) | 0),
        (r = (((r << 16) | (r >>> 16)) + i) | 0),
        (n += ((r ^ i ^ o) + l[10] - 1094730640) | 0),
        (n = (((n << 23) | (n >>> 9)) + r) | 0),
        (o += ((n ^ r ^ i) + l[13] + 681279174) | 0),
        (o = (((o << 4) | (o >>> 28)) + n) | 0),
        (i += ((o ^ n ^ r) + l[0] - 358537222) | 0),
        (i = (((i << 11) | (i >>> 21)) + o) | 0),
        (r += ((i ^ o ^ n) + l[3] - 722521979) | 0),
        (r = (((r << 16) | (r >>> 16)) + i) | 0),
        (n += ((r ^ i ^ o) + l[6] + 76029189) | 0),
        (n = (((n << 23) | (n >>> 9)) + r) | 0),
        (o += ((n ^ r ^ i) + l[9] - 640364487) | 0),
        (o = (((o << 4) | (o >>> 28)) + n) | 0),
        (i += ((o ^ n ^ r) + l[12] - 421815835) | 0),
        (i = (((i << 11) | (i >>> 21)) + o) | 0),
        (r += ((i ^ o ^ n) + l[15] + 530742520) | 0),
        (r = (((r << 16) | (r >>> 16)) + i) | 0),
        (n += ((r ^ i ^ o) + l[2] - 995338651) | 0),
        (n = (((n << 23) | (n >>> 9)) + r) | 0),
        (o += ((r ^ (n | ~i)) + l[0] - 198630844) | 0),
        (o = (((o << 6) | (o >>> 26)) + n) | 0),
        (i += ((n ^ (o | ~r)) + l[7] + 1126891415) | 0),
        (i = (((i << 10) | (i >>> 22)) + o) | 0),
        (r += ((o ^ (i | ~n)) + l[14] - 1416354905) | 0),
        (r = (((r << 15) | (r >>> 17)) + i) | 0),
        (n += ((i ^ (r | ~o)) + l[5] - 57434055) | 0),
        (n = (((n << 21) | (n >>> 11)) + r) | 0),
        (o += ((r ^ (n | ~i)) + l[12] + 1700485571) | 0),
        (o = (((o << 6) | (o >>> 26)) + n) | 0),
        (i += ((n ^ (o | ~r)) + l[3] - 1894986606) | 0),
        (i = (((i << 10) | (i >>> 22)) + o) | 0),
        (r += ((o ^ (i | ~n)) + l[10] - 1051523) | 0),
        (r = (((r << 15) | (r >>> 17)) + i) | 0),
        (n += ((i ^ (r | ~o)) + l[1] - 2054922799) | 0),
        (n = (((n << 21) | (n >>> 11)) + r) | 0),
        (o += ((r ^ (n | ~i)) + l[8] + 1873313359) | 0),
        (o = (((o << 6) | (o >>> 26)) + n) | 0),
        (i += ((n ^ (o | ~r)) + l[15] - 30611744) | 0),
        (i = (((i << 10) | (i >>> 22)) + o) | 0),
        (r += ((o ^ (i | ~n)) + l[6] - 1560198380) | 0),
        (r = (((r << 15) | (r >>> 17)) + i) | 0),
        (n += ((i ^ (r | ~o)) + l[13] + 1309151649) | 0),
        (n = (((n << 21) | (n >>> 11)) + r) | 0),
        (o += ((r ^ (n | ~i)) + l[4] - 145523070) | 0),
        (o = (((o << 6) | (o >>> 26)) + n) | 0),
        (i += ((n ^ (o | ~r)) + l[11] - 1120210379) | 0),
        (i = (((i << 10) | (i >>> 22)) + o) | 0),
        (r += ((o ^ (i | ~n)) + l[2] + 718787259) | 0),
        (r = (((r << 15) | (r >>> 17)) + i) | 0),
        (n += ((i ^ (r | ~o)) + l[9] - 343485551) | 0),
        (n = (((n << 21) | (n >>> 11)) + r) | 0),
        (v[0] = (o + v[0]) | 0),
        (v[1] = (n + v[1]) | 0),
        (v[2] = (r + v[2]) | 0),
        (v[3] = (i + v[3]) | 0));
    }
    function F(v) {
      var l = [],
        o;
      for (o = 0; o < 64; o += 4)
        l[o >> 2] =
          v.charCodeAt(o) +
          (v.charCodeAt(o + 1) << 8) +
          (v.charCodeAt(o + 2) << 16) +
          (v.charCodeAt(o + 3) << 24);
      return l;
    }
    function K(v) {
      var l = [],
        o;
      for (o = 0; o < 64; o += 4)
        l[o >> 2] =
          v[o] + (v[o + 1] << 8) + (v[o + 2] << 16) + (v[o + 3] << 24);
      return l;
    }
    function I(v) {
      var l = v.length,
        o = [1732584193, -271733879, -1732584194, 271733878],
        n,
        r,
        i,
        N,
        P,
        q;
      for (n = 64; n <= l; n += 64) $(o, F(v.substring(n - 64, n)));
      for (
        v = v.substring(n - 64),
          r = v.length,
          i = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
          n = 0;
        n < r;
        n += 1
      )
        i[n >> 2] |= v.charCodeAt(n) << (n % 4 << 3);
      if (((i[n >> 2] |= 128 << (n % 4 << 3)), n > 55))
        for ($(o, i), n = 0; n < 16; n += 1) i[n] = 0;
      return (
        (N = l * 8),
        (N = N.toString(16).match(/(.*?)(.{0,8})$/)),
        (P = parseInt(N[2], 16)),
        (q = parseInt(N[1], 16) || 0),
        (i[14] = P),
        (i[15] = q),
        $(o, i),
        o
      );
    }
    function L(v) {
      var l = v.length,
        o = [1732584193, -271733879, -1732584194, 271733878],
        n,
        r,
        i,
        N,
        P,
        q;
      for (n = 64; n <= l; n += 64) $(o, K(v.subarray(n - 64, n)));
      for (
        v = n - 64 < l ? v.subarray(n - 64) : new Uint8Array(0),
          r = v.length,
          i = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
          n = 0;
        n < r;
        n += 1
      )
        i[n >> 2] |= v[n] << (n % 4 << 3);
      if (((i[n >> 2] |= 128 << (n % 4 << 3)), n > 55))
        for ($(o, i), n = 0; n < 16; n += 1) i[n] = 0;
      return (
        (N = l * 8),
        (N = N.toString(16).match(/(.*?)(.{0,8})$/)),
        (P = parseInt(N[2], 16)),
        (q = parseInt(N[1], 16) || 0),
        (i[14] = P),
        (i[15] = q),
        $(o, i),
        o
      );
    }
    function M(v) {
      var l = "",
        o;
      for (o = 0; o < 4; o += 1)
        l += B[(v >> (o * 8 + 4)) & 15] + B[(v >> (o * 8)) & 15];
      return l;
    }
    function G(v) {
      var l;
      for (l = 0; l < v.length; l += 1) v[l] = M(v[l]);
      return v.join("");
    }
    (G(I("hello")),
      typeof ArrayBuffer < "u" &&
        !ArrayBuffer.prototype.slice &&
        (function () {
          function v(l, o) {
            return (
              (l = l | 0 || 0),
              l < 0 ? Math.max(l + o, 0) : Math.min(l, o)
            );
          }
          ArrayBuffer.prototype.slice = function (l, o) {
            var n = this.byteLength,
              r = v(l, n),
              i = n,
              N,
              P,
              q,
              te;
            return (
              o !== k && (i = v(o, n)),
              r > i
                ? new ArrayBuffer(0)
                : ((N = i - r),
                  (P = new ArrayBuffer(N)),
                  (q = new Uint8Array(P)),
                  (te = new Uint8Array(this, r, N)),
                  q.set(te),
                  P)
            );
          };
        })());
    function x(v) {
      return (
        /[\u0080-\uFFFF]/.test(v) && (v = unescape(encodeURIComponent(v))),
        v
      );
    }
    function R(v, l) {
      var o = v.length,
        n = new ArrayBuffer(o),
        r = new Uint8Array(n),
        i;
      for (i = 0; i < o; i += 1) r[i] = v.charCodeAt(i);
      return l ? r : n;
    }
    function H(v) {
      return String.fromCharCode.apply(null, new Uint8Array(v));
    }
    function W(v, l, o) {
      var n = new Uint8Array(v.byteLength + l.byteLength);
      return (
        n.set(new Uint8Array(v)),
        n.set(new Uint8Array(l), v.byteLength),
        o ? n : n.buffer
      );
    }
    function ee(v) {
      var l = [],
        o = v.length,
        n;
      for (n = 0; n < o - 1; n += 2) l.push(parseInt(v.substr(n, 2), 16));
      return String.fromCharCode.apply(String, l);
    }
    function T() {
      this.reset();
    }
    return (
      (T.prototype.append = function (v) {
        return (this.appendBinary(x(v)), this);
      }),
      (T.prototype.appendBinary = function (v) {
        ((this._buff += v), (this._length += v.length));
        var l = this._buff.length,
          o;
        for (o = 64; o <= l; o += 64)
          $(this._hash, F(this._buff.substring(o - 64, o)));
        return ((this._buff = this._buff.substring(o - 64)), this);
      }),
      (T.prototype.end = function (v) {
        var l = this._buff,
          o = l.length,
          n,
          r = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
          i;
        for (n = 0; n < o; n += 1) r[n >> 2] |= l.charCodeAt(n) << (n % 4 << 3);
        return (
          this._finish(r, o),
          (i = G(this._hash)),
          v && (i = ee(i)),
          this.reset(),
          i
        );
      }),
      (T.prototype.reset = function () {
        return (
          (this._buff = ""),
          (this._length = 0),
          (this._hash = [1732584193, -271733879, -1732584194, 271733878]),
          this
        );
      }),
      (T.prototype.getState = function () {
        return {
          buff: this._buff,
          length: this._length,
          hash: this._hash.slice(),
        };
      }),
      (T.prototype.setState = function (v) {
        return (
          (this._buff = v.buff),
          (this._length = v.length),
          (this._hash = v.hash),
          this
        );
      }),
      (T.prototype.destroy = function () {
        (delete this._hash, delete this._buff, delete this._length);
      }),
      (T.prototype._finish = function (v, l) {
        var o = l,
          n,
          r,
          i;
        if (((v[o >> 2] |= 128 << (o % 4 << 3)), o > 55))
          for ($(this._hash, v), o = 0; o < 16; o += 1) v[o] = 0;
        ((n = this._length * 8),
          (n = n.toString(16).match(/(.*?)(.{0,8})$/)),
          (r = parseInt(n[2], 16)),
          (i = parseInt(n[1], 16) || 0),
          (v[14] = r),
          (v[15] = i),
          $(this._hash, v));
      }),
      (T.hash = function (v, l) {
        return T.hashBinary(x(v), l);
      }),
      (T.hashBinary = function (v, l) {
        var o = I(v),
          n = G(o);
        return l ? ee(n) : n;
      }),
      (T.ArrayBuffer = function () {
        this.reset();
      }),
      (T.ArrayBuffer.prototype.append = function (v) {
        var l = W(this._buff.buffer, v, !0),
          o = l.length,
          n;
        for (this._length += v.byteLength, n = 64; n <= o; n += 64)
          $(this._hash, K(l.subarray(n - 64, n)));
        return (
          (this._buff =
            n - 64 < o
              ? new Uint8Array(l.buffer.slice(n - 64))
              : new Uint8Array(0)),
          this
        );
      }),
      (T.ArrayBuffer.prototype.end = function (v) {
        var l = this._buff,
          o = l.length,
          n = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
          r,
          i;
        for (r = 0; r < o; r += 1) n[r >> 2] |= l[r] << (r % 4 << 3);
        return (
          this._finish(n, o),
          (i = G(this._hash)),
          v && (i = ee(i)),
          this.reset(),
          i
        );
      }),
      (T.ArrayBuffer.prototype.reset = function () {
        return (
          (this._buff = new Uint8Array(0)),
          (this._length = 0),
          (this._hash = [1732584193, -271733879, -1732584194, 271733878]),
          this
        );
      }),
      (T.ArrayBuffer.prototype.getState = function () {
        var v = T.prototype.getState.call(this);
        return ((v.buff = H(v.buff)), v);
      }),
      (T.ArrayBuffer.prototype.setState = function (v) {
        return ((v.buff = R(v.buff, !0)), T.prototype.setState.call(this, v));
      }),
      (T.ArrayBuffer.prototype.destroy = T.prototype.destroy),
      (T.ArrayBuffer.prototype._finish = T.prototype._finish),
      (T.ArrayBuffer.hash = function (v, l) {
        var o = L(new Uint8Array(v)),
          n = G(o);
        return l ? ee(n) : n;
      }),
      T
    );
  });
})(Tt);
var Mn = Tt.exports;
const zn = /* @__PURE__ */ $n(Mn),
  Dt = "3.7.8",
  jn = Dt,
  Ie = typeof Buffer == "function",
  Et = typeof TextDecoder == "function" ? new TextDecoder() : void 0,
  Ct = typeof TextEncoder == "function" ? new TextEncoder() : void 0,
  Vn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  De = Array.prototype.slice.call(Vn),
  $e = ((d) => {
    let C = {};
    return (d.forEach((k, B) => (C[k] = B)), C);
  })(De),
  Yn =
    /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,
  re = String.fromCharCode.bind(String),
  Nt =
    typeof Uint8Array.from == "function"
      ? Uint8Array.from.bind(Uint8Array)
      : (d) => new Uint8Array(Array.prototype.slice.call(d, 0)),
  Ft = (d) =>
    d.replace(/=/g, "").replace(/[+\/]/g, (C) => (C == "+" ? "-" : "_")),
  Ut = (d) => d.replace(/[^A-Za-z0-9\+\/]/g, ""),
  Pt = (d) => {
    let C,
      k,
      B,
      $,
      F = "";
    const K = d.length % 3;
    for (let I = 0; I < d.length; ) {
      if (
        (k = d.charCodeAt(I++)) > 255 ||
        (B = d.charCodeAt(I++)) > 255 ||
        ($ = d.charCodeAt(I++)) > 255
      )
        throw new TypeError("invalid character found");
      ((C = (k << 16) | (B << 8) | $),
        (F +=
          De[(C >> 18) & 63] +
          De[(C >> 12) & 63] +
          De[(C >> 6) & 63] +
          De[C & 63]));
    }
    return K ? F.slice(0, K - 3) + "===".substring(K) : F;
  },
  Ze =
    typeof btoa == "function"
      ? (d) => btoa(d)
      : Ie
        ? (d) => Buffer.from(d, "binary").toString("base64")
        : Pt,
  Ge = Ie
    ? (d) => Buffer.from(d).toString("base64")
    : (d) => {
        let k = [];
        for (let B = 0, $ = d.length; B < $; B += 4096)
          k.push(re.apply(null, d.subarray(B, B + 4096)));
        return Ze(k.join(""));
      },
  ze = (d, C = !1) => (C ? Ft(Ge(d)) : Ge(d)),
  Wn = (d) => {
    if (d.length < 2) {
      var C = d.charCodeAt(0);
      return C < 128
        ? d
        : C < 2048
          ? re(192 | (C >>> 6)) + re(128 | (C & 63))
          : re(224 | ((C >>> 12) & 15)) +
            re(128 | ((C >>> 6) & 63)) +
            re(128 | (C & 63));
    } else {
      var C =
        65536 + (d.charCodeAt(0) - 55296) * 1024 + (d.charCodeAt(1) - 56320);
      return (
        re(240 | ((C >>> 18) & 7)) +
        re(128 | ((C >>> 12) & 63)) +
        re(128 | ((C >>> 6) & 63)) +
        re(128 | (C & 63))
      );
    }
  },
  qn = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,
  Lt = (d) => d.replace(qn, Wn),
  Bt = Ie
    ? (d) => Buffer.from(d, "utf8").toString("base64")
    : Ct
      ? (d) => Ge(Ct.encode(d))
      : (d) => Ze(Lt(d)),
  xe = (d, C = !1) => (C ? Ft(Bt(d)) : Bt(d)),
  Rt = (d) => xe(d, !0),
  Hn =
    /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,
  Jn = (d) => {
    switch (d.length) {
      case 4:
        var C =
            ((7 & d.charCodeAt(0)) << 18) |
            ((63 & d.charCodeAt(1)) << 12) |
            ((63 & d.charCodeAt(2)) << 6) |
            (63 & d.charCodeAt(3)),
          k = C - 65536;
        return re((k >>> 10) + 55296) + re((k & 1023) + 56320);
      case 3:
        return re(
          ((15 & d.charCodeAt(0)) << 12) |
            ((63 & d.charCodeAt(1)) << 6) |
            (63 & d.charCodeAt(2)),
        );
      default:
        return re(((31 & d.charCodeAt(0)) << 6) | (63 & d.charCodeAt(1)));
    }
  },
  Ot = (d) => d.replace(Hn, Jn),
  kt = (d) => {
    if (((d = d.replace(/\s+/g, "")), !Yn.test(d)))
      throw new TypeError("malformed base64.");
    d += "==".slice(2 - (d.length & 3));
    let C,
      k,
      B,
      $ = [];
    for (let F = 0; F < d.length; )
      ((C =
        ($e[d.charAt(F++)] << 18) |
        ($e[d.charAt(F++)] << 12) |
        ((k = $e[d.charAt(F++)]) << 6) |
        (B = $e[d.charAt(F++)])),
        k === 64
          ? $.push(re((C >> 16) & 255))
          : B === 64
            ? $.push(re((C >> 16) & 255, (C >> 8) & 255))
            : $.push(re((C >> 16) & 255, (C >> 8) & 255, C & 255)));
    return $.join("");
  },
  et =
    typeof atob == "function"
      ? (d) => atob(Ut(d))
      : Ie
        ? (d) => Buffer.from(d, "base64").toString("binary")
        : kt,
  $t = Ie
    ? (d) => Nt(Buffer.from(d, "base64"))
    : (d) =>
        Nt(
          et(d)
            .split("")
            .map((C) => C.charCodeAt(0)),
        ),
  Mt = (d) => $t(zt(d)),
  Kn = Ie
    ? (d) => Buffer.from(d, "base64").toString("utf8")
    : Et
      ? (d) => Et.decode($t(d))
      : (d) => Ot(et(d)),
  zt = (d) => Ut(d.replace(/[-_]/g, (C) => (C == "-" ? "+" : "/"))),
  Qe = (d) => Kn(zt(d)),
  Xn = (d) => {
    if (typeof d != "string") return !1;
    const C = d.replace(/\s+/g, "").replace(/={0,2}$/, "");
    return !/[^\s0-9a-zA-Z\+/]/.test(C) || !/[^\s0-9a-zA-Z\-_]/.test(C);
  },
  jt = (d) => ({
    value: d,
    enumerable: !1,
    writable: !0,
    configurable: !0,
  }),
  Vt = function () {
    const d = (C, k) => Object.defineProperty(String.prototype, C, jt(k));
    (d("fromBase64", function () {
      return Qe(this);
    }),
      d("toBase64", function (C) {
        return xe(this, C);
      }),
      d("toBase64URI", function () {
        return xe(this, !0);
      }),
      d("toBase64URL", function () {
        return xe(this, !0);
      }),
      d("toUint8Array", function () {
        return Mt(this);
      }));
  },
  Yt = function () {
    const d = (C, k) => Object.defineProperty(Uint8Array.prototype, C, jt(k));
    (d("toBase64", function (C) {
      return ze(this, C);
    }),
      d("toBase64URI", function () {
        return ze(this, !0);
      }),
      d("toBase64URL", function () {
        return ze(this, !0);
      }));
  },
  Gn = () => {
    (Vt(), Yt());
  },
  Qn = {
    version: Dt,
    VERSION: jn,
    atob: et,
    atobPolyfill: kt,
    btoa: Ze,
    btoaPolyfill: Pt,
    fromBase64: Qe,
    toBase64: xe,
    encode: xe,
    encodeURI: Rt,
    encodeURL: Rt,
    utob: Lt,
    btou: Ot,
    decode: Qe,
    isValid: Xn,
    fromUint8Array: ze,
    toUint8Array: Mt,
    extendString: Vt,
    extendUint8Array: Yt,
    extendBuiltins: Gn,
  },
  Zn = { class: "xde-uploader-container" },
  er = { key: 0 },
  tr = { class: "upload-controls" },
  nr = {
    key: 0,
    class: "upload-hint",
  },
  rr = { class: "file-header" },
  or = { class: "file-info" },
  ar = { class: "file-meta" },
  ir = { class: "file-name" },
  sr = { class: "file-actions" },
  ur = ["onClick"],
  cr = ["onClick"],
  lr = ["onClick"],
  fr = {
    key: 0,
    class: "upload-progress",
  },
  dr = { class: "progress-header" },
  hr = { class: "status-text" },
  vr = {
    key: 1,
    class: "file-status",
  },
  pr = {
    key: 0,
    class: "upload-progress",
  },
  mr = { class: "progress-header" },
  gr = { class: "status-text" },
  yr = "/uap/docCenter/preSignedUrls",
  br = "/uap/docCenter/preSignedUrl",
  _r = "/uap/docCenter/uploadToLocalDisk",
  wr = "/uap/docCenter/downloadFromLocalDisk",
  Sr = "/uap/docCenter/downloadFromLocalDiskByDocId",
  xr = "/uap/docCenter/preview",
  Ir = "/uap/docCenter/fileServerPath",
  Ar = "/mvr/vtk/importModel",
  Er = "/mvr/vtk/getProjectIdByFilePath",
  Cr = "/uap/docCenter/objectExists",
  Nr = "/uap/docCenter/mergeChunks",
  Br = /* @__PURE__ */ Rn({
    name: "XdeFileUploader",
    __name: "index",
    props: {
      bucketConfig: {},
      uploadToFileServer: { type: Boolean, default: !0 },
      accept: { default: "" },
      limit: {},
      maxHeight: { default: 300 },
      maxSize: { default: -1 },
      hintText: { default: "" },
      buttonText: { default: "选择文件" },
      multiple: { type: Boolean, default: !0 },
      chunkSize: { default: 10 * 1024 * 1024 },
      uploadedFiles: { default: () => [] },
      asyncUpload: { type: Boolean, default: !0 },
      showFileList: { type: Boolean, default: !0 },
      showProcessDialog: { type: Boolean, default: !0 },
      disabledUpload: { type: Boolean, default: !1 },
      uploadFolder: { type: Boolean, default: !1 },
      ifUpload: { type: Boolean, default: !0 },
      filePreview: { type: Boolean, default: !1 },
      docHandler: { default: "" },
    },
    emits: ["fileList-change", "upload-complete"],
    setup(d, { expose: C, emit: k }) {
      const B = d,
        $ = k,
        { proxy: F } = Tn(),
        K = pe(null);
      pe([]);
      const I = pe({}),
        L = pe([]),
        M = pe([]),
        G = pe([]),
        x = pe([]),
        R = pe(!1),
        H = Xe(() =>
          typeof B.limit == "number" && B.limit >= 0 ? B.limit : null,
        ),
        W = Xe(() => [...M.value.filter((f) => !f.__deleted), ...L.value]),
        ee = Xe(() => B.showProcessDialog && R.value);
      (bt(
        () => B.uploadedFiles,
        (f) => {
          const _ = new Set(
              M.value.filter((m) => m.__deleted).map((m) => m.uid),
            ),
            w = new Set(M.value.map((m) => m.uid)),
            S = l(f || [], w, _);
          M.value = [...S];
        },
        { immediate: !0, deep: !0 },
      ),
        bt(
          () => B.uploadFolder,
          (f) => {
            Dn(() => {
              var w;
              const _ = (w = K.value) == null ? void 0 : w.$el;
              if (_) {
                const S = _.querySelector('input[type="file"]');
                S && (S.webkitdirectory = f);
              }
            });
          },
          { immediate: !0 },
        ));
      const T = async (f) => {
          if (L.value.filter((w) => w.status === "ready").length === 0) {
            kn.warning("没有需要上传的文件");
            return;
          }
          (await ae(f), await me(f));
        },
        v = () => {
          ((L.value = []), (M.value = []));
        };
      function l(f, _, w) {
        return f
          .filter((S) => !_.has(S.uid) && !w.has(S.uid))
          .map((S) => ({
            ...S,
            __static: !0,
            // 标记为外部
            uid: S.uid || o(),
            status: S.status || "success",
            percentage: S.percentage || 100,
            size: S.size || 0,
            __deleted: !1,
          }));
      }
      const o = () =>
          Date.now().toString(36) + Math.random().toString(36).substr(2),
        n = async (f) =>
          new Promise(async (_) => {
            var D, U, J;
            const w =
                (D = I == null ? void 0 : I.value[f.uid]) == null
                  ? void 0
                  : D.chunkConfig.fileMd5,
              S = Ce(f.raw),
              m = {
                bucketName:
                  (U = I == null ? void 0 : I.value[f.uid]) == null
                    ? void 0
                    : U.config.bucketName,
                objectName:
                  (J = I == null ? void 0 : I.value[f.uid]) == null
                    ? void 0
                    : J.config.objectName,
              },
              A = S.map((ne, X) => ({
                ...m,
                action: "upload",
                objectName: `${w}/${m != null && m.objectName.includes(".") ? m.objectName.substring(0, m.objectName.lastIndexOf(".")) : m == null ? void 0 : m.objectName}/${X}`,
              })),
              z = {
                fileMd5: w,
                totalChunks: Ee(f),
                uploadedChunks: [],
                chunksStatus: A.map((ne) => ({
                  ...ne,
                  uploadStatus: !1,
                })),
              };
            let j = w + "/" + f.name.substring(0, f.name.lastIndexOf("."));
            (!localStorage.getItem(j) &&
              localStorage.setItem(j, JSON.stringify(z)),
              _(z.chunksStatus));
          }),
        r = async (f) =>
          new Promise(async (_) => {
            var z, j, D;
            const w =
                (z = I == null ? void 0 : I.value[f.uid]) == null
                  ? void 0
                  : z.chunkConfig.fileMd5,
              S = Ce(f.raw),
              m = {
                bucketName:
                  (j = I == null ? void 0 : I.value[f.uid]) == null
                    ? void 0
                    : j.config.bucketName,
                objectName:
                  (D = I == null ? void 0 : I.value[f.uid]) == null
                    ? void 0
                    : D.config.objectName,
              },
              A = S.map((U, J) => ({
                ...m,
                action: "upload",
                objectName: `${w}/${m != null && m.objectName.includes(".") ? m.objectName.substring(0, m.objectName.lastIndexOf(".")) : m == null ? void 0 : m.objectName}/${J}`,
              }));
            if (F.$request)
              try {
                const U = await F.$request({
                    url: yr,
                    method: "post",
                    data: A,
                  }),
                  J = {
                    fileMd5: w,
                    totalChunks: Ee(f),
                    uploadedChunks: [],
                    chunksStatus: A.map((X, he) => ({
                      ...X,
                      presignedUrl: U[he],
                      uploadStatus: !1,
                    })),
                  };
                let ne = w + "/" + f.name.substring(0, f.name.lastIndexOf("."));
                (!localStorage.getItem(ne) &&
                  localStorage.setItem(ne, JSON.stringify(J)),
                  _(J.chunksStatus));
              } catch (U) {
                (console.error(U), this.$message.error("获取上传授权失败"));
              }
          }),
        i = (f) =>
          f
            ? f < 1024
              ? f + " Bytes"
              : f < 1024 * 1024
                ? (f / 1024).toFixed(1) + " KB"
                : f < 1024 * 1024 * 1024
                  ? (f / (1024 * 1024)).toFixed(1) + " MB"
                  : (f / (1024 * 1024 * 1024)).toFixed(1) + " GB"
            : "0 Bytes",
        N = (f) => {
          const _ = f.name.split(".").pop().toLowerCase();
          return ["jpg", "jpeg", "png", "gif", "bmp", "svg"].includes(_)
            ? "el-icon-picture"
            : "el-icon-document";
        },
        P = (f) => {
          switch (f.status) {
            case "ready":
              return "等待上传";
            case "uploading":
              return `上传中 ${f.percentage}%`;
            case "success":
              return "上传成功";
            case "fail":
              return "上传失败";
            default:
              return f.status;
          }
        },
        q = async (f, _) => {
          $("fileList-change", f, _, (w) => {
            ((L.value = _.filter((S) => !S.__static)
              .filter((S) => {
                if (B.accept) {
                  const m = B.accept.split(","),
                    A = S.type || "",
                    z = S.name.split(".").pop().toLowerCase();
                  if (
                    !m.some(
                      (D) => (
                        (D = D.trim().toLowerCase()),
                        D === A || z === D.replace(".", "") || D === `.${z}`
                      ),
                    )
                  )
                    return !1;
                }
                return !0;
              })
              .map((S) => (f.uid === S.uid ? { ...S, ...w } : S))),
              f.status === "ready" &&
                (I.value[f.uid] = {
                  xhr: null,
                  config: {
                    ...w,
                    uid: f.uid,
                    fileName: f.name,
                    totalSize: f.size,
                  },
                }));
          });
        },
        te = (f) => {
          var m;
          let _ = !0;
          const w = L.value.findIndex((A) => A.uid === f.uid);
          if (w !== -1) L.value.splice(w, 1);
          else {
            const A = M.value.findIndex((z) => z.uid === f.uid);
            A !== -1 &&
              (M.value[A].__static
                ? (M.value[A].__deleted = !0)
                : M.value.splice(A, 1),
              (_ = !1));
          }
          const S = I.value[f.uid];
          if (
            (_ &&
              f.status === "uploading" &&
              S &&
              ((m = S.xhr) == null || m.abort()),
            _ && S)
          ) {
            const A = S.configIndex;
            A !== void 0 && (x.value[A] = !1);
          }
          (S && delete I.value[f.uid],
            (G.value = G.value.filter((A) => A.uid !== f.uid)),
            oe());
        },
        oe = () => {
          const f = W.value.filter((A) => !A.__deleted),
            _ = f.filter((A) => A.status === "success" && !A.__static),
            w = f.filter((A) => A.status === "fail" && !A.__static),
            S = [
              ...G.value,
              ...M.value
                .filter((A) => A.__static && !A.__deleted)
                .map((A) => ({
                  uid: A.uid,
                  bucketName: A.bucketName || "",
                  objectName: A.objectName || "",
                  fileName: A.name,
                  isExisting: !0,
                })),
            ],
            m = {
              successFiles: _,
              failedFiles: w,
              total: f.length,
              filesConfig: S,
              allFiles: f,
            };
          $("upload-complete", m);
        },
        ae = (f) => {
          if (B.accept) {
            const _ = B.accept.split(","),
              w = f.type || "",
              S = f.name.split(".").pop().toLowerCase(),
              m = _.some(
                (A) => (
                  (A = A.trim().toLowerCase()),
                  A === w || S === A.replace(".", "") || A === `.${S}`
                ),
              );
            if (B.uploadFolder && !m) return !1;
            if (!m)
              return (
                this.$message.error(
                  `不支持的文件类型: ${f.name}，只支持 ${B.accept} 格式`,
                ),
                !1
              );
          }
          return B.maxSize !== -1 && f.size > B.maxSize
            ? (this.$message.error(
                `文件大小超出限制: ${f.name} (最大允许 ${i(B.maxSize)})`,
              ),
              !1)
            : ((f.percentage = 0),
              new Promise(async (_) => {
                try {
                  console.log("文件配置:", f, I.value);
                  const w = f.uid;
                  if (!I.value[w].chunkConfig) {
                    const S = await Fe(f.raw);
                    let m =
                      S + "/" + f.name.substring(0, f.name.lastIndexOf("."));
                    const A = localStorage.getItem(m)
                      ? JSON.parse(localStorage.getItem(m))
                      : void 0;
                    I.value[w].chunkConfig = A || {
                      fileMd5: S,
                      totalChunks: Ee(f),
                      uploadedChunks: [],
                    };
                  }
                  _(!0);
                } catch (w) {
                  console.log(w, "错误2");
                }
              }));
        },
        le = (f) => {},
        me = async (f) => {
          try {
            const _ = I.value[f.uid],
              w = await de(_),
              S = Ce(f.raw).map((D, U) => ({ chunkIndex: U, chunkBolb: D }));
            let m = [];
            if (w.exists === !0) {
              ((f.status = "success"),
                (f.docId = w.docId),
                (L.value = L.value.map((D) => ({
                  ...D,
                  docId: w.docId,
                  status: D.uid === f.uid ? "success" : D.status,
                }))),
                fe());
              return;
            } else if (
              _.chunkConfig.uploadedChunks &&
              _.chunkConfig.uploadedChunks.length
            )
              m = S.filter((D, U) => !_.chunkConfig.uploadedChunks.includes(U));
            else {
              if (B.uploadToFileServer) {
                const D = await r(f);
                I.value[f.uid].chunkConfig.chunksStatus = D;
              } else {
                const D = await n(f);
                I.value[f.uid].chunkConfig.chunksStatus = D;
              }
              m = S;
            }
            R.value = !0;
            const A = new Array(m.length).fill(0),
              z = L.value.find((D) => D.uid === _.config.uid);
            z && (z.chunkProgress = A);
            let j = [];
            for (let D = 0; D < m.length; D++)
              try {
                B.uploadToFileServer
                  ? j.push(Ae(m[D].chunkBolb, _, m[D].chunkIndex, D, A))
                  : j.push(
                      be(m[D].chunkBolb, _, m[D].chunkIndex, D, A, m.length),
                    );
              } catch {
                break;
              }
            Promise.all(j).then((D) => {
              L.value.some(
                (U) => U.status === "uploading" || U.status === "ready",
              ) || (R.value = !1);
            });
          } catch (_) {
            (console.log("=>(index.vue:661) error", _),
              (f.status = "fail"),
              (L.value = L.value.map((w) => ({
                ...w,
                status: w.uid === f.uid ? "fail" : w.status,
              }))));
          }
        },
        be = (f, _, w, S, m, A) => {
          const z = L.value.find((j) => j.uid === _.config.uid);
          return (
            z && (z.status = "uploading"),
            new Promise((j, D) => {
              const U = new FormData();
              (U.append("file", f),
                F.$request({
                  url:
                    _r +
                    `?bucketName=${_.config.bucketName}&objectName=${_.chunkConfig.chunksStatus[w].objectName}`,
                  method: "post",
                  data: U,
                })
                  .then(async (J) => {
                    let ne =
                      _.chunkConfig.fileMd5 +
                      "/" +
                      _.config.fileName.substring(
                        0,
                        _.config.fileName.lastIndexOf("."),
                      );
                    const X = localStorage.getItem(ne)
                      ? JSON.parse(localStorage.getItem(ne))
                      : {
                          fileMd5: "",
                          totalChunks: 0,
                          uploadedChunks: [],
                          chunksStatus: [],
                        };
                    ((X.uploadedChunks = X.uploadedChunks.includes(w)
                      ? X.uploadedChunks
                      : [...X.uploadedChunks, w]),
                      (X.chunksStatus = X.chunksStatus.map((he, ge) => ({
                        ...he,
                        uploadStatus: ge === w || he.uploadStatus,
                      }))),
                      localStorage.setItem(ne, JSON.stringify(X)),
                      z &&
                        (z.percentage = Math.round(
                          (X.uploadedChunks.length / A) * 100,
                        )),
                      X.chunksStatus.length === X.uploadedChunks.length &&
                        (await Pe(_, z, X.fileMd5), fe()),
                      j(null));
                  })
                  .catch((J) => {
                    (console.log("=>(index.vue:641) 上传报错", J),
                      (R.value = !1),
                      D(J));
                  }));
            })
          );
        },
        Ae = (f, _, w, S, m) =>
          new Promise((A, z) => {
            const j = new XMLHttpRequest();
            ((I.value[_.config.uid].xhr = j),
              j.open("PUT", _.chunkConfig.chunksStatus[w].presignedUrl, !0),
              j.setRequestHeader(
                "Content-Type",
                f.type || "application/octet-stream",
              ));
            const D = L.value.find((U) => U.uid === _.config.uid);
            (D && (D.status = "uploading"),
              (j.upload.onprogress = (U) => {
                if (U.lengthComputable) {
                  const J = Math.round((U.loaded / U.total) * 100);
                  m[S] = J;
                  const ne = m.length,
                    X = m.reduce((ge, Ne) => ge + Ne, 0),
                    he = Math.round(X / ne);
                  D && (D.percentage = he);
                }
              }),
              (j.onload = async () => {
                if (j.status >= 200 && j.status < 300) {
                  let U =
                    _.chunkConfig.fileMd5 +
                    "/" +
                    _.config.fileName.substring(
                      0,
                      _.config.fileName.lastIndexOf("."),
                    );
                  const J = localStorage.getItem(U)
                    ? JSON.parse(localStorage.getItem(U))
                    : {
                        fileMd5: "",
                        totalChunks: 0,
                        uploadedChunks: [],
                        chunksStatus: [],
                      };
                  ((J.uploadedChunks = J.uploadedChunks.includes(w)
                    ? J.uploadedChunks
                    : [...J.uploadedChunks, w]),
                    (J.chunksStatus = J.chunksStatus.map((ne, X) => ({
                      ...ne,
                      uploadStatus: X === w || ne.uploadStatus,
                    }))),
                    localStorage.setItem(U, JSON.stringify(J)),
                    J.chunksStatus.length === J.uploadedChunks.length &&
                      (await Pe(_, D, J.fileMd5), await fe()),
                    A(null));
                } else
                  ((D.status = "fail"),
                    (L.value = L.value.map((U) => ({
                      ...U,
                      status: U.uid === _.config.uid ? "fail" : U.status,
                    }))),
                    z("上传失败"));
              }),
              (j.onerror = () => {
                (D && (D.status = "fail"),
                  (L.value = L.value.map((U) => ({
                    ...U,
                    status: U.uid === _.config.uid ? "fail" : U.status,
                  }))),
                  fe(),
                  z("上传失败"));
              }),
              j.send(f));
          }),
        fe = () => {
          L.value.some(
            (f) => f.status === "uploading" || f.status === "ready",
          ) || oe();
        },
        Fe = (f) =>
          new Promise((_) => {
            const w = new FileReader();
            ((w.onload = function (S) {
              const m = new zn.ArrayBuffer();
              (m.append(S.target.result), _(m.end()));
            }),
              w.readAsArrayBuffer(f));
          }),
        Ee = (f) => Math.ceil((f.size || 0) / B.chunkSize),
        Ce = (f) => {
          const _ = [];
          if (f.size > B.chunkSize)
            for (let w = 0; w < f.size; w += B.chunkSize)
              _.push(f.slice(w, w + B.chunkSize));
          else _.push(f.slice(0));
          return _;
        },
        de = async (f) =>
          await F.$request({
            url: Cr,
            method: "get",
            params: {
              bucketName: f.config.bucketName,
              objectName: `${f.config.objectName}`,
              fileMd5: `${f.chunkConfig.fileMd5}`,
              uploadToFileServer: B.uploadToFileServer,
            },
          }),
        Ue = async (f, _, w) => {
          const S = {
              bucketName: f,
              action: "download",
              objectName: _,
              docId: w,
            },
            m = await F.$request({
              url: br,
              method: "get",
              params: S,
            });
          return m || (console.warn("下载请求返回异常数据:", m), null);
        },
        je = async (f) => {
          if (["stp", "igs", "stl"].includes(f.name.split(".").pop())) {
            const w = await F.$request({
                url: Ir + "?docId=" + f.docId,
                method: "get",
              }),
              S = await F.$request({
                url: Er + "?filePath=" + w,
                method: "get",
              });
            let m = null;
            if (S) m = S;
            else {
              const z = this.$loading({
                  lock: !0,
                  text: "模型首次加载中...",
                }),
                j = await F.$request({
                  url: Ar,
                  method: "post",
                  data: {
                    filePath: w,
                    name: w.md5,
                  },
                });
              (z.close(), (m = j.id));
            }
            let A =
              process.env.NODE_ENV === "development"
                ? "http://127.0.0.1:8081"
                : "/mvr";
            window.open(
              `${A}/mvrView?projectId=${m}&type=CAD&isProject=null&hasModel=true`,
            );
          } else {
            const w = await F.$request({
              url: xr + "?docId=" + f.docId,
              method: "get",
            });
            let S =
              process.env.NODE_ENV === "development"
                ? "http://127.0.0.1:8012"
                : "/kkfile";
            window.open(
              `${S}/onlinePreview?url=` + encodeURIComponent(Qn.encode(w)),
            );
          }
        },
        Ve = async (f) => {
          if (B.uploadToFileServer) {
            const _ = await Ue(f.bucketName, f.objectName, f.docId),
              w = document.createElement("a");
            ((w.href = _),
              (w.download = f.name || "downloaded-file"),
              document.body.appendChild(w),
              w.click(),
              document.body.removeChild(w));
          } else {
            let _ = f.docId ? Sr : wr,
              w = f.docId
                ? {
                    docId: f.docId,
                  }
                : {
                    bucketName:
                      f.bucketName || I.value[f.uid].config.bucketName,
                    objectName:
                      f.objectName || I.value[f.uid].config.objectName,
                  };
            F.$request({
              url: _,
              method: "get",
              params: w,
              responseType: "blob",
            }).then((S) => {
              const m = URL.createObjectURL(S),
                A = document.createElement("a");
              ((A.href = m),
                (A.download = f.name || "downloaded-file"),
                document.body.appendChild(A),
                A.click(),
                document.body.removeChild(A),
                URL.revokeObjectURL(m));
            });
          }
        },
        Pe = async (f, _, w) => {
          try {
            const S = await F.$request({
                url: Nr,
                method: "get",
                params: {
                  bucketName: f.config.bucketName,
                  fileMd5: f.chunkConfig.fileMd5,
                  objectName: f.config.objectName,
                  totalChunks: f.chunkConfig.totalChunks,
                  uploadToFileServer: B.uploadToFileServer,
                },
              }),
              m = {
                uid: _.uid,
                bucketName: f.config.bucketName,
                objectName: f.config.objectName,
                fileName: _.name,
                isExisting: !1,
                docId: S ? S.id : "",
              };
            G.value.push(m);
            let A = w + "/" + _.name.substring(0, _.name.lastIndexOf("."));
            (localStorage.removeItem(A),
              (_.status = "success"),
              (_.docId = S ? S.id : ""));
            const z = L.value.find((j) => j.uid === _.uid);
            z &&
              ((z.docId = S ? S.id : ""),
              (z.businessResult = S ? S.businessResult : ""));
          } catch {
            let m = w + "/" + _.name.substring(0, _.name.lastIndexOf("."));
            localStorage.removeItem(m);
          }
        };
      return (
        C({
          startUpload: T,
          clearFileList: v,
        }),
        (f, _) => {
          const w = _t("el-icon"),
            S = _t("el-tag");
          return (
            ie(),
            se("div", Zn, [
              d.ifUpload
                ? (ie(),
                  se("div", er, [
                    ye(
                      Te(Pn),
                      {
                        ref_key: "uploadRef",
                        ref: K,
                        action: "",
                        "http-request": le,
                        "file-list": W.value,
                        "on-change": q,
                        "on-remove": te,
                        multiple: d.multiple,
                        accept: d.accept,
                        limit: H.value,
                        disabled:
                          (H.value && W.value.length === H.value) ||
                          d.disabledUpload,
                        "show-file-list": !1,
                      },
                      {
                        default: Oe(() => [
                          ce("div", tr, [
                            Fn(
                              f.$slots,
                              "uploadIcon",
                              {},
                              () => [
                                ye(
                                  Te(Ln),
                                  {
                                    disabled:
                                      W.value.length === H.value ||
                                      d.disabledUpload,
                                    type: "primary",
                                  },
                                  {
                                    default: Oe(() => [
                                      wt(we(d.buttonText), 1),
                                    ]),
                                    _: 1,
                                  },
                                  8,
                                  ["disabled"],
                                ),
                              ],
                              !0,
                            ),
                          ]),
                        ]),
                        _: 3,
                      },
                      8,
                      ["file-list", "multiple", "accept", "limit", "disabled"],
                    ),
                    d.hintText
                      ? (ie(), se("div", nr, we(d.hintText), 1))
                      : Se("", !0),
                  ]))
                : Se("", !0),
              d.showFileList
                ? (ie(),
                  se(
                    "div",
                    {
                      key: 1,
                      class: "file-list-container",
                      style: Un({ "max-height": d.maxHeight + "px" }),
                    },
                    [
                      (ie(!0),
                      se(
                        St,
                        null,
                        xt(
                          W.value,
                          (m) => (
                            ie(),
                            se(
                              "div",
                              {
                                key: m.uid,
                                class: "file-item",
                              },
                              [
                                ce("div", rr, [
                                  ce("div", or, [
                                    ye(
                                      w,
                                      {
                                        class: It(["file-icon", N(m)]),
                                      },
                                      null,
                                      8,
                                      ["class"],
                                    ),
                                    ce("div", ar, [
                                      ce("div", ir, we(m.name), 1),
                                    ]),
                                  ]),
                                  ce("div", sr, [
                                    d.filePreview
                                      ? (ie(),
                                        se(
                                          "i",
                                          {
                                            key: 0,
                                            class:
                                              "el-icon-zoom-in preview-icon",
                                            onClick: (A) => je(m),
                                          },
                                          null,
                                          8,
                                          ur,
                                        ))
                                      : Se("", !0),
                                    ce(
                                      "i",
                                      {
                                        class:
                                          "el-icon-download download-icon download-style",
                                        onClick: (A) => Ve(m),
                                      },
                                      null,
                                      8,
                                      cr,
                                    ),
                                    d.ifUpload
                                      ? (ie(),
                                        se(
                                          "i",
                                          {
                                            key: 1,
                                            class: "el-icon-delete remove-icon",
                                            onClick: (A) => te(m),
                                          },
                                          null,
                                          8,
                                          lr,
                                        ))
                                      : Se("", !0),
                                  ]),
                                ]),
                                m.status === "uploading"
                                  ? (ie(),
                                    se("div", fr, [
                                      ce("div", dr, [
                                        ce("span", hr, we(P(m)), 1),
                                      ]),
                                      ye(
                                        Te(At),
                                        {
                                          "text-inside": !1,
                                          "stroke-width": 2,
                                          percentage: m.percentage || 0,
                                          color: "#1664B5",
                                        },
                                        null,
                                        8,
                                        ["percentage"],
                                      ),
                                    ]))
                                  : (ie(),
                                    se("div", vr, [
                                      ye(
                                        S,
                                        {
                                          type:
                                            m.status === "success"
                                              ? "success"
                                              : "info",
                                          effect: "plain",
                                          size: "small",
                                        },
                                        {
                                          default: Oe(() => [
                                            ce(
                                              "i",
                                              {
                                                class: It(
                                                  m.status === "success"
                                                    ? "el-icon-check"
                                                    : "",
                                                ),
                                              },
                                              null,
                                              2,
                                            ),
                                            wt(" " + we(P(m)), 1),
                                          ]),
                                          _: 2,
                                        },
                                        1032,
                                        ["type"],
                                      ),
                                    ])),
                              ],
                            )
                          ),
                        ),
                        128,
                      )),
                    ],
                    4,
                  ))
                : Se("", !0),
              ye(
                Te(On),
                {
                  modelValue: ee.value,
                  "onUpdate:modelValue": _[0] || (_[0] = (m) => (ee.value = m)),
                  "show-close": !1,
                  "close-on-press-escape": !1,
                  "close-on-click-modal": !1,
                  width: "400px",
                  title: "文件上传进度",
                  "append-to-body": "",
                },
                {
                  default: Oe(() => [
                    (ie(!0),
                    se(
                      St,
                      null,
                      xt(
                        W.value,
                        (m) => (
                          ie(),
                          se(
                            "div",
                            {
                              key: m.uid,
                              class: "file-item",
                            },
                            [
                              m.status === "uploading"
                                ? (ie(),
                                  se("div", pr, [
                                    ce("div", mr, [
                                      ce("span", gr, we(m.name + P(m)), 1),
                                    ]),
                                    ye(
                                      Te(At),
                                      {
                                        "text-inside": !0,
                                        "stroke-width": 20,
                                        percentage: m.percentage || 0,
                                        status:
                                          m.percentage === 100
                                            ? "success"
                                            : "warning",
                                      },
                                      null,
                                      8,
                                      ["percentage", "status"],
                                    ),
                                  ]))
                                : Se("", !0),
                            ],
                          )
                        ),
                      ),
                      128,
                    )),
                  ]),
                  _: 1,
                },
                8,
                ["modelValue"],
              ),
            ])
          );
        }
      );
    },
  });
const Rr = (d, C) => {
    const k = d.__vccOpts || d;
    for (const [B, $] of C) k[B] = $;
    return k;
  },
  Pr = /* @__PURE__ */ Rr(Br, [["__scopeId", "data-v-9703c687"]]);
function Me(d) {
  throw new Error(
    'Could not dynamically require "' +
      d +
      '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.',
  );
}
var Tr = { exports: {} };
/*!
    localForage -- Offline Storage, Improved
    Version 1.10.0
    https://localforage.github.io/localForage
    (c) 2013-2017 Mozilla, Apache License 2.0
*/
(function (d, C) {
  (function (k) {
    d.exports = k();
  })(function () {
    return (function k(B, $, F) {
      function K(M, G) {
        if (!$[M]) {
          if (!B[M]) {
            var x = typeof Me == "function" && Me;
            if (!G && x) return x(M, !0);
            if (I) return I(M, !0);
            var R = new Error("Cannot find module '" + M + "'");
            throw ((R.code = "MODULE_NOT_FOUND"), R);
          }
          var H = ($[M] = { exports: {} });
          B[M][0].call(
            H.exports,
            function (W) {
              var ee = B[M][1][W];
              return K(ee || W);
            },
            H,
            H.exports,
            k,
            B,
            $,
            F,
          );
        }
        return $[M].exports;
      }
      for (var I = typeof Me == "function" && Me, L = 0; L < F.length; L++)
        K(F[L]);
      return K;
    })(
      {
        1: [
          function (k, B, $) {
            (function (F) {
              var K = F.MutationObserver || F.WebKitMutationObserver,
                I;
              if (K) {
                var L = 0,
                  M = new K(W),
                  G = F.document.createTextNode("");
                (M.observe(G, {
                  characterData: !0,
                }),
                  (I = function () {
                    G.data = L = ++L % 2;
                  }));
              } else if (!F.setImmediate && typeof F.MessageChannel < "u") {
                var x = new F.MessageChannel();
                ((x.port1.onmessage = W),
                  (I = function () {
                    x.port2.postMessage(0);
                  }));
              } else
                "document" in F &&
                "onreadystatechange" in F.document.createElement("script")
                  ? (I = function () {
                      var T = F.document.createElement("script");
                      ((T.onreadystatechange = function () {
                        (W(),
                          (T.onreadystatechange = null),
                          T.parentNode.removeChild(T),
                          (T = null));
                      }),
                        F.document.documentElement.appendChild(T));
                    })
                  : (I = function () {
                      setTimeout(W, 0);
                    });
              var R,
                H = [];
              function W() {
                R = !0;
                for (var T, v, l = H.length; l; ) {
                  for (v = H, H = [], T = -1; ++T < l; ) v[T]();
                  l = H.length;
                }
                R = !1;
              }
              B.exports = ee;
              function ee(T) {
                H.push(T) === 1 && !R && I();
              }
            }).call(
              this,
              typeof ke < "u"
                ? ke
                : typeof self < "u"
                  ? self
                  : typeof window < "u"
                    ? window
                    : {},
            );
          },
          {},
        ],
        2: [
          function (k, B, $) {
            var F = k(1);
            function K() {}
            var I = {},
              L = ["REJECTED"],
              M = ["FULFILLED"],
              G = ["PENDING"];
            B.exports = x;
            function x(r) {
              if (typeof r != "function")
                throw new TypeError("resolver must be a function");
              ((this.state = G),
                (this.queue = []),
                (this.outcome = void 0),
                r !== K && ee(this, r));
            }
            ((x.prototype.catch = function (r) {
              return this.then(null, r);
            }),
              (x.prototype.then = function (r, i) {
                if (
                  (typeof r != "function" && this.state === M) ||
                  (typeof i != "function" && this.state === L)
                )
                  return this;
                var N = new this.constructor(K);
                if (this.state !== G) {
                  var P = this.state === M ? r : i;
                  H(N, P, this.outcome);
                } else this.queue.push(new R(N, r, i));
                return N;
              }));
            function R(r, i, N) {
              ((this.promise = r),
                typeof i == "function" &&
                  ((this.onFulfilled = i),
                  (this.callFulfilled = this.otherCallFulfilled)),
                typeof N == "function" &&
                  ((this.onRejected = N),
                  (this.callRejected = this.otherCallRejected)));
            }
            ((R.prototype.callFulfilled = function (r) {
              I.resolve(this.promise, r);
            }),
              (R.prototype.otherCallFulfilled = function (r) {
                H(this.promise, this.onFulfilled, r);
              }),
              (R.prototype.callRejected = function (r) {
                I.reject(this.promise, r);
              }),
              (R.prototype.otherCallRejected = function (r) {
                H(this.promise, this.onRejected, r);
              }));
            function H(r, i, N) {
              F(function () {
                var P;
                try {
                  P = i(N);
                } catch (q) {
                  return I.reject(r, q);
                }
                P === r
                  ? I.reject(
                      r,
                      new TypeError("Cannot resolve promise with itself"),
                    )
                  : I.resolve(r, P);
              });
            }
            ((I.resolve = function (r, i) {
              var N = T(W, i);
              if (N.status === "error") return I.reject(r, N.value);
              var P = N.value;
              if (P) ee(r, P);
              else {
                ((r.state = M), (r.outcome = i));
                for (var q = -1, te = r.queue.length; ++q < te; )
                  r.queue[q].callFulfilled(i);
              }
              return r;
            }),
              (I.reject = function (r, i) {
                ((r.state = L), (r.outcome = i));
                for (var N = -1, P = r.queue.length; ++N < P; )
                  r.queue[N].callRejected(i);
                return r;
              }));
            function W(r) {
              var i = r && r.then;
              if (
                r &&
                (typeof r == "object" || typeof r == "function") &&
                typeof i == "function"
              )
                return function () {
                  i.apply(r, arguments);
                };
            }
            function ee(r, i) {
              var N = !1;
              function P(ae) {
                N || ((N = !0), I.reject(r, ae));
              }
              function q(ae) {
                N || ((N = !0), I.resolve(r, ae));
              }
              function te() {
                i(q, P);
              }
              var oe = T(te);
              oe.status === "error" && P(oe.value);
            }
            function T(r, i) {
              var N = {};
              try {
                ((N.value = r(i)), (N.status = "success"));
              } catch (P) {
                ((N.status = "error"), (N.value = P));
              }
              return N;
            }
            x.resolve = v;
            function v(r) {
              return r instanceof this ? r : I.resolve(new this(K), r);
            }
            x.reject = l;
            function l(r) {
              var i = new this(K);
              return I.reject(i, r);
            }
            x.all = o;
            function o(r) {
              var i = this;
              if (Object.prototype.toString.call(r) !== "[object Array]")
                return this.reject(new TypeError("must be an array"));
              var N = r.length,
                P = !1;
              if (!N) return this.resolve([]);
              for (
                var q = new Array(N), te = 0, oe = -1, ae = new this(K);
                ++oe < N;

              )
                le(r[oe], oe);
              return ae;
              function le(me, be) {
                i.resolve(me).then(Ae, function (fe) {
                  P || ((P = !0), I.reject(ae, fe));
                });
                function Ae(fe) {
                  ((q[be] = fe),
                    ++te === N && !P && ((P = !0), I.resolve(ae, q)));
                }
              }
            }
            x.race = n;
            function n(r) {
              var i = this;
              if (Object.prototype.toString.call(r) !== "[object Array]")
                return this.reject(new TypeError("must be an array"));
              var N = r.length,
                P = !1;
              if (!N) return this.resolve([]);
              for (var q = -1, te = new this(K); ++q < N; ) oe(r[q]);
              return te;
              function oe(ae) {
                i.resolve(ae).then(
                  function (le) {
                    P || ((P = !0), I.resolve(te, le));
                  },
                  function (le) {
                    P || ((P = !0), I.reject(te, le));
                  },
                );
              }
            }
          },
          { 1: 1 },
        ],
        3: [
          function (k, B, $) {
            (function (F) {
              typeof F.Promise != "function" && (F.Promise = k(2));
            }).call(
              this,
              typeof ke < "u"
                ? ke
                : typeof self < "u"
                  ? self
                  : typeof window < "u"
                    ? window
                    : {},
            );
          },
          { 2: 2 },
        ],
        4: [
          function (k, B, $) {
            var F =
              typeof Symbol == "function" && typeof Symbol.iterator == "symbol"
                ? function (e) {
                    return typeof e;
                  }
                : function (e) {
                    return e &&
                      typeof Symbol == "function" &&
                      e.constructor === Symbol &&
                      e !== Symbol.prototype
                      ? "symbol"
                      : typeof e;
                  };
            function K(e, a) {
              if (!(e instanceof a))
                throw new TypeError("Cannot call a class as a function");
            }
            function I() {
              try {
                if (typeof indexedDB < "u") return indexedDB;
                if (typeof webkitIndexedDB < "u") return webkitIndexedDB;
                if (typeof mozIndexedDB < "u") return mozIndexedDB;
                if (typeof OIndexedDB < "u") return OIndexedDB;
                if (typeof msIndexedDB < "u") return msIndexedDB;
              } catch {
                return;
              }
            }
            var L = I();
            function M() {
              try {
                if (!L || !L.open) return !1;
                var e =
                    typeof openDatabase < "u" &&
                    /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) &&
                    !/Chrome/.test(navigator.userAgent) &&
                    !/BlackBerry/.test(navigator.platform),
                  a =
                    typeof fetch == "function" &&
                    fetch.toString().indexOf("[native code") !== -1;
                return (
                  (!e || a) &&
                  typeof indexedDB < "u" && // some outdated implementations of IDB that appear on Samsung
                  // and HTC Android devices <4.4 are missing IDBKeyRange
                  // See: https://github.com/mozilla/localForage/issues/128
                  // See: https://github.com/mozilla/localForage/issues/272
                  typeof IDBKeyRange < "u"
                );
              } catch {
                return !1;
              }
            }
            function G(e, a) {
              ((e = e || []), (a = a || {}));
              try {
                return new Blob(e, a);
              } catch (s) {
                if (s.name !== "TypeError") throw s;
                for (
                  var t =
                      typeof BlobBuilder < "u"
                        ? BlobBuilder
                        : typeof MSBlobBuilder < "u"
                          ? MSBlobBuilder
                          : typeof MozBlobBuilder < "u"
                            ? MozBlobBuilder
                            : WebKitBlobBuilder,
                    u = new t(),
                    c = 0;
                  c < e.length;
                  c += 1
                )
                  u.append(e[c]);
                return u.getBlob(a.type);
              }
            }
            typeof Promise > "u" && k(3);
            var x = Promise;
            function R(e, a) {
              a &&
                e.then(
                  function (t) {
                    a(null, t);
                  },
                  function (t) {
                    a(t);
                  },
                );
            }
            function H(e, a, t) {
              (typeof a == "function" && e.then(a),
                typeof t == "function" && e.catch(t));
            }
            function W(e) {
              return (
                typeof e != "string" &&
                  (console.warn(e + " used as a key, but it is not a string."),
                  (e = String(e))),
                e
              );
            }
            function ee() {
              if (
                arguments.length &&
                typeof arguments[arguments.length - 1] == "function"
              )
                return arguments[arguments.length - 1];
            }
            var T = "local-forage-detect-blob-support",
              v = void 0,
              l = {},
              o = Object.prototype.toString,
              n = "readonly",
              r = "readwrite";
            function i(e) {
              for (
                var a = e.length,
                  t = new ArrayBuffer(a),
                  u = new Uint8Array(t),
                  c = 0;
                c < a;
                c++
              )
                u[c] = e.charCodeAt(c);
              return t;
            }
            function N(e) {
              return new x(function (a) {
                var t = e.transaction(T, r),
                  u = G([""]);
                (t.objectStore(T).put(u, "key"),
                  (t.onabort = function (c) {
                    (c.preventDefault(), c.stopPropagation(), a(!1));
                  }),
                  (t.oncomplete = function () {
                    var c = navigator.userAgent.match(/Chrome\/(\d+)/),
                      s = navigator.userAgent.match(/Edge\//);
                    a(s || !c || parseInt(c[1], 10) >= 43);
                  }));
              }).catch(function () {
                return !1;
              });
            }
            function P(e) {
              return typeof v == "boolean"
                ? x.resolve(v)
                : N(e).then(function (a) {
                    return ((v = a), v);
                  });
            }
            function q(e) {
              var a = l[e.name],
                t = {};
              ((t.promise = new x(function (u, c) {
                ((t.resolve = u), (t.reject = c));
              })),
                a.deferredOperations.push(t),
                a.dbReady
                  ? (a.dbReady = a.dbReady.then(function () {
                      return t.promise;
                    }))
                  : (a.dbReady = t.promise));
            }
            function te(e) {
              var a = l[e.name],
                t = a.deferredOperations.pop();
              if (t) return (t.resolve(), t.promise);
            }
            function oe(e, a) {
              var t = l[e.name],
                u = t.deferredOperations.pop();
              if (u) return (u.reject(a), u.promise);
            }
            function ae(e, a) {
              return new x(function (t, u) {
                if (((l[e.name] = l[e.name] || Ue()), e.db))
                  if (a) (q(e), e.db.close());
                  else return t(e.db);
                var c = [e.name];
                a && c.push(e.version);
                var s = L.open.apply(L, c);
                (a &&
                  (s.onupgradeneeded = function (h) {
                    var p = s.result;
                    try {
                      (p.createObjectStore(e.storeName),
                        h.oldVersion <= 1 && p.createObjectStore(T));
                    } catch (g) {
                      if (g.name === "ConstraintError")
                        console.warn(
                          'The database "' +
                            e.name +
                            '" has been upgraded from version ' +
                            h.oldVersion +
                            " to version " +
                            h.newVersion +
                            ', but the storage "' +
                            e.storeName +
                            '" already exists.',
                        );
                      else throw g;
                    }
                  }),
                  (s.onerror = function (h) {
                    (h.preventDefault(), u(s.error));
                  }),
                  (s.onsuccess = function () {
                    var h = s.result;
                    ((h.onversionchange = function (p) {
                      p.target.close();
                    }),
                      t(h),
                      te(e));
                  }));
              });
            }
            function le(e) {
              return ae(e, !1);
            }
            function me(e) {
              return ae(e, !0);
            }
            function be(e, a) {
              if (!e.db) return !0;
              var t = !e.db.objectStoreNames.contains(e.storeName),
                u = e.version < e.db.version,
                c = e.version > e.db.version;
              if (
                (u &&
                  (e.version !== a &&
                    console.warn(
                      'The database "' +
                        e.name +
                        `" can't be downgraded from version ` +
                        e.db.version +
                        " to version " +
                        e.version +
                        ".",
                    ),
                  (e.version = e.db.version)),
                c || t)
              ) {
                if (t) {
                  var s = e.db.version + 1;
                  s > e.version && (e.version = s);
                }
                return !0;
              }
              return !1;
            }
            function Ae(e) {
              return new x(function (a, t) {
                var u = new FileReader();
                ((u.onerror = t),
                  (u.onloadend = function (c) {
                    var s = btoa(c.target.result || "");
                    a({
                      __local_forage_encoded_blob: !0,
                      data: s,
                      type: e.type,
                    });
                  }),
                  u.readAsBinaryString(e));
              });
            }
            function fe(e) {
              var a = i(atob(e.data));
              return G([a], { type: e.type });
            }
            function Fe(e) {
              return e && e.__local_forage_encoded_blob;
            }
            function Ee(e) {
              var a = this,
                t = a._initReady().then(function () {
                  var u = l[a._dbInfo.name];
                  if (u && u.dbReady) return u.dbReady;
                });
              return (H(t, e, e), t);
            }
            function Ce(e) {
              q(e);
              for (var a = l[e.name], t = a.forages, u = 0; u < t.length; u++) {
                var c = t[u];
                c._dbInfo.db && (c._dbInfo.db.close(), (c._dbInfo.db = null));
              }
              return (
                (e.db = null),
                le(e)
                  .then(function (s) {
                    return ((e.db = s), be(e) ? me(e) : s);
                  })
                  .then(function (s) {
                    e.db = a.db = s;
                    for (var h = 0; h < t.length; h++) t[h]._dbInfo.db = s;
                  })
                  .catch(function (s) {
                    throw (oe(e, s), s);
                  })
              );
            }
            function de(e, a, t, u) {
              u === void 0 && (u = 1);
              try {
                var c = e.db.transaction(e.storeName, a);
                t(null, c);
              } catch (s) {
                if (
                  u > 0 &&
                  (!e.db ||
                    s.name === "InvalidStateError" ||
                    s.name === "NotFoundError")
                )
                  return x
                    .resolve()
                    .then(function () {
                      if (
                        !e.db ||
                        (s.name === "NotFoundError" &&
                          !e.db.objectStoreNames.contains(e.storeName) &&
                          e.version <= e.db.version)
                      )
                        return (e.db && (e.version = e.db.version + 1), me(e));
                    })
                    .then(function () {
                      return Ce(e).then(function () {
                        de(e, a, t, u - 1);
                      });
                    })
                    .catch(t);
                t(s);
              }
            }
            function Ue() {
              return {
                // Running localForages sharing a database.
                forages: [],
                // Shared database.
                db: null,
                // Database readiness (promise).
                dbReady: null,
                // Deferred operations on the database.
                deferredOperations: [],
              };
            }
            function je(e) {
              var a = this,
                t = {
                  db: null,
                };
              if (e) for (var u in e) t[u] = e[u];
              var c = l[t.name];
              (c || ((c = Ue()), (l[t.name] = c)),
                c.forages.push(a),
                a._initReady || ((a._initReady = a.ready), (a.ready = Ee)));
              var s = [];
              function h() {
                return x.resolve();
              }
              for (var p = 0; p < c.forages.length; p++) {
                var g = c.forages[p];
                g !== a && s.push(g._initReady().catch(h));
              }
              var y = c.forages.slice(0);
              return x
                .all(s)
                .then(function () {
                  return ((t.db = c.db), le(t));
                })
                .then(function (b) {
                  return (
                    (t.db = b),
                    be(t, a._defaultConfig.version) ? me(t) : b
                  );
                })
                .then(function (b) {
                  ((t.db = c.db = b), (a._dbInfo = t));
                  for (var E = 0; E < y.length; E++) {
                    var O = y[E];
                    O !== a &&
                      ((O._dbInfo.db = t.db), (O._dbInfo.version = t.version));
                  }
                });
            }
            function Ve(e, a) {
              var t = this;
              e = W(e);
              var u = new x(function (c, s) {
                t.ready()
                  .then(function () {
                    de(t._dbInfo, n, function (h, p) {
                      if (h) return s(h);
                      try {
                        var g = p.objectStore(t._dbInfo.storeName),
                          y = g.get(e);
                        ((y.onsuccess = function () {
                          var b = y.result;
                          (b === void 0 && (b = null),
                            Fe(b) && (b = fe(b)),
                            c(b));
                        }),
                          (y.onerror = function () {
                            s(y.error);
                          }));
                      } catch (b) {
                        s(b);
                      }
                    });
                  })
                  .catch(s);
              });
              return (R(u, a), u);
            }
            function Pe(e, a) {
              var t = this,
                u = new x(function (c, s) {
                  t.ready()
                    .then(function () {
                      de(t._dbInfo, n, function (h, p) {
                        if (h) return s(h);
                        try {
                          var g = p.objectStore(t._dbInfo.storeName),
                            y = g.openCursor(),
                            b = 1;
                          ((y.onsuccess = function () {
                            var E = y.result;
                            if (E) {
                              var O = E.value;
                              Fe(O) && (O = fe(O));
                              var V = e(O, E.key, b++);
                              V !== void 0 ? c(V) : E.continue();
                            } else c();
                          }),
                            (y.onerror = function () {
                              s(y.error);
                            }));
                        } catch (E) {
                          s(E);
                        }
                      });
                    })
                    .catch(s);
                });
              return (R(u, a), u);
            }
            function f(e, a, t) {
              var u = this;
              e = W(e);
              var c = new x(function (s, h) {
                var p;
                u.ready()
                  .then(function () {
                    return (
                      (p = u._dbInfo),
                      o.call(a) === "[object Blob]"
                        ? P(p.db).then(function (g) {
                            return g ? a : Ae(a);
                          })
                        : a
                    );
                  })
                  .then(function (g) {
                    de(u._dbInfo, r, function (y, b) {
                      if (y) return h(y);
                      try {
                        var E = b.objectStore(u._dbInfo.storeName);
                        g === null && (g = void 0);
                        var O = E.put(g, e);
                        ((b.oncomplete = function () {
                          (g === void 0 && (g = null), s(g));
                        }),
                          (b.onabort = b.onerror =
                            function () {
                              var V = O.error ? O.error : O.transaction.error;
                              h(V);
                            }));
                      } catch (V) {
                        h(V);
                      }
                    });
                  })
                  .catch(h);
              });
              return (R(c, t), c);
            }
            function _(e, a) {
              var t = this;
              e = W(e);
              var u = new x(function (c, s) {
                t.ready()
                  .then(function () {
                    de(t._dbInfo, r, function (h, p) {
                      if (h) return s(h);
                      try {
                        var g = p.objectStore(t._dbInfo.storeName),
                          y = g.delete(e);
                        ((p.oncomplete = function () {
                          c();
                        }),
                          (p.onerror = function () {
                            s(y.error);
                          }),
                          (p.onabort = function () {
                            var b = y.error ? y.error : y.transaction.error;
                            s(b);
                          }));
                      } catch (b) {
                        s(b);
                      }
                    });
                  })
                  .catch(s);
              });
              return (R(u, a), u);
            }
            function w(e) {
              var a = this,
                t = new x(function (u, c) {
                  a.ready()
                    .then(function () {
                      de(a._dbInfo, r, function (s, h) {
                        if (s) return c(s);
                        try {
                          var p = h.objectStore(a._dbInfo.storeName),
                            g = p.clear();
                          ((h.oncomplete = function () {
                            u();
                          }),
                            (h.onabort = h.onerror =
                              function () {
                                var y = g.error ? g.error : g.transaction.error;
                                c(y);
                              }));
                        } catch (y) {
                          c(y);
                        }
                      });
                    })
                    .catch(c);
                });
              return (R(t, e), t);
            }
            function S(e) {
              var a = this,
                t = new x(function (u, c) {
                  a.ready()
                    .then(function () {
                      de(a._dbInfo, n, function (s, h) {
                        if (s) return c(s);
                        try {
                          var p = h.objectStore(a._dbInfo.storeName),
                            g = p.count();
                          ((g.onsuccess = function () {
                            u(g.result);
                          }),
                            (g.onerror = function () {
                              c(g.error);
                            }));
                        } catch (y) {
                          c(y);
                        }
                      });
                    })
                    .catch(c);
                });
              return (R(t, e), t);
            }
            function m(e, a) {
              var t = this,
                u = new x(function (c, s) {
                  if (e < 0) {
                    c(null);
                    return;
                  }
                  t.ready()
                    .then(function () {
                      de(t._dbInfo, n, function (h, p) {
                        if (h) return s(h);
                        try {
                          var g = p.objectStore(t._dbInfo.storeName),
                            y = !1,
                            b = g.openKeyCursor();
                          ((b.onsuccess = function () {
                            var E = b.result;
                            if (!E) {
                              c(null);
                              return;
                            }
                            e === 0 || y ? c(E.key) : ((y = !0), E.advance(e));
                          }),
                            (b.onerror = function () {
                              s(b.error);
                            }));
                        } catch (E) {
                          s(E);
                        }
                      });
                    })
                    .catch(s);
                });
              return (R(u, a), u);
            }
            function A(e) {
              var a = this,
                t = new x(function (u, c) {
                  a.ready()
                    .then(function () {
                      de(a._dbInfo, n, function (s, h) {
                        if (s) return c(s);
                        try {
                          var p = h.objectStore(a._dbInfo.storeName),
                            g = p.openKeyCursor(),
                            y = [];
                          ((g.onsuccess = function () {
                            var b = g.result;
                            if (!b) {
                              u(y);
                              return;
                            }
                            (y.push(b.key), b.continue());
                          }),
                            (g.onerror = function () {
                              c(g.error);
                            }));
                        } catch (b) {
                          c(b);
                        }
                      });
                    })
                    .catch(c);
                });
              return (R(t, e), t);
            }
            function z(e, a) {
              a = ee.apply(this, arguments);
              var t = this.config();
              ((e = (typeof e != "function" && e) || {}),
                e.name ||
                  ((e.name = e.name || t.name),
                  (e.storeName = e.storeName || t.storeName)));
              var u = this,
                c;
              if (!e.name) c = x.reject("Invalid arguments");
              else {
                var s = e.name === t.name && u._dbInfo.db,
                  h = s
                    ? x.resolve(u._dbInfo.db)
                    : le(e).then(function (p) {
                        var g = l[e.name],
                          y = g.forages;
                        g.db = p;
                        for (var b = 0; b < y.length; b++) y[b]._dbInfo.db = p;
                        return p;
                      });
                e.storeName
                  ? (c = h.then(function (p) {
                      if (p.objectStoreNames.contains(e.storeName)) {
                        var g = p.version + 1;
                        q(e);
                        var y = l[e.name],
                          b = y.forages;
                        p.close();
                        for (var E = 0; E < b.length; E++) {
                          var O = b[E];
                          ((O._dbInfo.db = null), (O._dbInfo.version = g));
                        }
                        var V = new x(function (Y, Z) {
                          var Q = L.open(e.name, g);
                          ((Q.onerror = function (ue) {
                            var Re = Q.result;
                            (Re.close(), Z(ue));
                          }),
                            (Q.onupgradeneeded = function () {
                              var ue = Q.result;
                              ue.deleteObjectStore(e.storeName);
                            }),
                            (Q.onsuccess = function () {
                              var ue = Q.result;
                              (ue.close(), Y(ue));
                            }));
                        });
                        return V.then(function (Y) {
                          y.db = Y;
                          for (var Z = 0; Z < b.length; Z++) {
                            var Q = b[Z];
                            ((Q._dbInfo.db = Y), te(Q._dbInfo));
                          }
                        }).catch(function (Y) {
                          throw (
                            (oe(e, Y) || x.resolve()).catch(function () {}),
                            Y
                          );
                        });
                      }
                    }))
                  : (c = h.then(function (p) {
                      q(e);
                      var g = l[e.name],
                        y = g.forages;
                      p.close();
                      for (var b = 0; b < y.length; b++) {
                        var E = y[b];
                        E._dbInfo.db = null;
                      }
                      var O = new x(function (V, Y) {
                        var Z = L.deleteDatabase(e.name);
                        ((Z.onerror = function () {
                          var Q = Z.result;
                          (Q && Q.close(), Y(Z.error));
                        }),
                          (Z.onblocked = function () {
                            console.warn(
                              'dropInstance blocked for database "' +
                                e.name +
                                '" until all open connections are closed',
                            );
                          }),
                          (Z.onsuccess = function () {
                            var Q = Z.result;
                            (Q && Q.close(), V(Q));
                          }));
                      });
                      return O.then(function (V) {
                        g.db = V;
                        for (var Y = 0; Y < y.length; Y++) {
                          var Z = y[Y];
                          te(Z._dbInfo);
                        }
                      }).catch(function (V) {
                        throw (
                          (oe(e, V) || x.resolve()).catch(function () {}),
                          V
                        );
                      });
                    }));
              }
              return (R(c, a), c);
            }
            var j = {
              _driver: "asyncStorage",
              _initStorage: je,
              _support: M(),
              iterate: Pe,
              getItem: Ve,
              setItem: f,
              removeItem: _,
              clear: w,
              length: S,
              key: m,
              keys: A,
              dropInstance: z,
            };
            function D() {
              return typeof openDatabase == "function";
            }
            var U =
                "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
              J = "~~local_forage_type~",
              ne = /^~~local_forage_type~([^~]+)~/,
              X = "__lfsc__:",
              he = X.length,
              ge = "arbf",
              Ne = "blob",
              tt = "si08",
              nt = "ui08",
              rt = "uic8",
              ot = "si16",
              at = "si32",
              it = "ur16",
              st = "ui32",
              ut = "fl32",
              ct = "fl64",
              lt = he + ge.length,
              ft = Object.prototype.toString;
            function dt(e) {
              var a = e.length * 0.75,
                t = e.length,
                u,
                c = 0,
                s,
                h,
                p,
                g;
              e[e.length - 1] === "=" && (a--, e[e.length - 2] === "=" && a--);
              var y = new ArrayBuffer(a),
                b = new Uint8Array(y);
              for (u = 0; u < t; u += 4)
                ((s = U.indexOf(e[u])),
                  (h = U.indexOf(e[u + 1])),
                  (p = U.indexOf(e[u + 2])),
                  (g = U.indexOf(e[u + 3])),
                  (b[c++] = (s << 2) | (h >> 4)),
                  (b[c++] = ((h & 15) << 4) | (p >> 2)),
                  (b[c++] = ((p & 3) << 6) | (g & 63)));
              return y;
            }
            function Ye(e) {
              var a = new Uint8Array(e),
                t = "",
                u;
              for (u = 0; u < a.length; u += 3)
                ((t += U[a[u] >> 2]),
                  (t += U[((a[u] & 3) << 4) | (a[u + 1] >> 4)]),
                  (t += U[((a[u + 1] & 15) << 2) | (a[u + 2] >> 6)]),
                  (t += U[a[u + 2] & 63]));
              return (
                a.length % 3 === 2
                  ? (t = t.substring(0, t.length - 1) + "=")
                  : a.length % 3 === 1 &&
                    (t = t.substring(0, t.length - 2) + "=="),
                t
              );
            }
            function Wt(e, a) {
              var t = "";
              if (
                (e && (t = ft.call(e)),
                e &&
                  (t === "[object ArrayBuffer]" ||
                    (e.buffer && ft.call(e.buffer) === "[object ArrayBuffer]")))
              ) {
                var u,
                  c = X;
                (e instanceof ArrayBuffer
                  ? ((u = e), (c += ge))
                  : ((u = e.buffer),
                    t === "[object Int8Array]"
                      ? (c += tt)
                      : t === "[object Uint8Array]"
                        ? (c += nt)
                        : t === "[object Uint8ClampedArray]"
                          ? (c += rt)
                          : t === "[object Int16Array]"
                            ? (c += ot)
                            : t === "[object Uint16Array]"
                              ? (c += it)
                              : t === "[object Int32Array]"
                                ? (c += at)
                                : t === "[object Uint32Array]"
                                  ? (c += st)
                                  : t === "[object Float32Array]"
                                    ? (c += ut)
                                    : t === "[object Float64Array]"
                                      ? (c += ct)
                                      : a(
                                          new Error(
                                            "Failed to get type for BinaryArray",
                                          ),
                                        )),
                  a(c + Ye(u)));
              } else if (t === "[object Blob]") {
                var s = new FileReader();
                ((s.onload = function () {
                  var h = J + e.type + "~" + Ye(this.result);
                  a(X + Ne + h);
                }),
                  s.readAsArrayBuffer(e));
              } else
                try {
                  a(JSON.stringify(e));
                } catch (h) {
                  (console.error(
                    "Couldn't convert value into a JSON string: ",
                    e,
                  ),
                    a(null, h));
                }
            }
            function qt(e) {
              if (e.substring(0, he) !== X) return JSON.parse(e);
              var a = e.substring(lt),
                t = e.substring(he, lt),
                u;
              if (t === Ne && ne.test(a)) {
                var c = a.match(ne);
                ((u = c[1]), (a = a.substring(c[0].length)));
              }
              var s = dt(a);
              switch (t) {
                case ge:
                  return s;
                case Ne:
                  return G([s], { type: u });
                case tt:
                  return new Int8Array(s);
                case nt:
                  return new Uint8Array(s);
                case rt:
                  return new Uint8ClampedArray(s);
                case ot:
                  return new Int16Array(s);
                case it:
                  return new Uint16Array(s);
                case at:
                  return new Int32Array(s);
                case st:
                  return new Uint32Array(s);
                case ut:
                  return new Float32Array(s);
                case ct:
                  return new Float64Array(s);
                default:
                  throw new Error("Unkown type: " + t);
              }
            }
            var We = {
              serialize: Wt,
              deserialize: qt,
              stringToBuffer: dt,
              bufferToString: Ye,
            };
            function ht(e, a, t, u) {
              e.executeSql(
                "CREATE TABLE IF NOT EXISTS " +
                  a.storeName +
                  " (id INTEGER PRIMARY KEY, key unique, value)",
                [],
                t,
                u,
              );
            }
            function Ht(e) {
              var a = this,
                t = {
                  db: null,
                };
              if (e)
                for (var u in e)
                  t[u] = typeof e[u] != "string" ? e[u].toString() : e[u];
              var c = new x(function (s, h) {
                try {
                  t.db = openDatabase(
                    t.name,
                    String(t.version),
                    t.description,
                    t.size,
                  );
                } catch (p) {
                  return h(p);
                }
                t.db.transaction(function (p) {
                  ht(
                    p,
                    t,
                    function () {
                      ((a._dbInfo = t), s());
                    },
                    function (g, y) {
                      h(y);
                    },
                  );
                }, h);
              });
              return ((t.serializer = We), c);
            }
            function ve(e, a, t, u, c, s) {
              e.executeSql(
                t,
                u,
                c,
                function (h, p) {
                  p.code === p.SYNTAX_ERR
                    ? h.executeSql(
                        "SELECT name FROM sqlite_master WHERE type='table' AND name = ?",
                        [a.storeName],
                        function (g, y) {
                          y.rows.length
                            ? s(g, p)
                            : ht(
                                g,
                                a,
                                function () {
                                  g.executeSql(t, u, c, s);
                                },
                                s,
                              );
                        },
                        s,
                      )
                    : s(h, p);
                },
                s,
              );
            }
            function Jt(e, a) {
              var t = this;
              e = W(e);
              var u = new x(function (c, s) {
                t.ready()
                  .then(function () {
                    var h = t._dbInfo;
                    h.db.transaction(function (p) {
                      ve(
                        p,
                        h,
                        "SELECT * FROM " +
                          h.storeName +
                          " WHERE key = ? LIMIT 1",
                        [e],
                        function (g, y) {
                          var b = y.rows.length ? y.rows.item(0).value : null;
                          (b && (b = h.serializer.deserialize(b)), c(b));
                        },
                        function (g, y) {
                          s(y);
                        },
                      );
                    });
                  })
                  .catch(s);
              });
              return (R(u, a), u);
            }
            function Kt(e, a) {
              var t = this,
                u = new x(function (c, s) {
                  t.ready()
                    .then(function () {
                      var h = t._dbInfo;
                      h.db.transaction(function (p) {
                        ve(
                          p,
                          h,
                          "SELECT * FROM " + h.storeName,
                          [],
                          function (g, y) {
                            for (
                              var b = y.rows, E = b.length, O = 0;
                              O < E;
                              O++
                            ) {
                              var V = b.item(O),
                                Y = V.value;
                              if (
                                (Y && (Y = h.serializer.deserialize(Y)),
                                (Y = e(Y, V.key, O + 1)),
                                Y !== void 0)
                              ) {
                                c(Y);
                                return;
                              }
                            }
                            c();
                          },
                          function (g, y) {
                            s(y);
                          },
                        );
                      });
                    })
                    .catch(s);
                });
              return (R(u, a), u);
            }
            function vt(e, a, t, u) {
              var c = this;
              e = W(e);
              var s = new x(function (h, p) {
                c.ready()
                  .then(function () {
                    a === void 0 && (a = null);
                    var g = a,
                      y = c._dbInfo;
                    y.serializer.serialize(a, function (b, E) {
                      E
                        ? p(E)
                        : y.db.transaction(
                            function (O) {
                              ve(
                                O,
                                y,
                                "INSERT OR REPLACE INTO " +
                                  y.storeName +
                                  " (key, value) VALUES (?, ?)",
                                [e, b],
                                function () {
                                  h(g);
                                },
                                function (V, Y) {
                                  p(Y);
                                },
                              );
                            },
                            function (O) {
                              if (O.code === O.QUOTA_ERR) {
                                if (u > 0) {
                                  h(vt.apply(c, [e, g, t, u - 1]));
                                  return;
                                }
                                p(O);
                              }
                            },
                          );
                    });
                  })
                  .catch(p);
              });
              return (R(s, t), s);
            }
            function Xt(e, a, t) {
              return vt.apply(this, [e, a, t, 1]);
            }
            function Gt(e, a) {
              var t = this;
              e = W(e);
              var u = new x(function (c, s) {
                t.ready()
                  .then(function () {
                    var h = t._dbInfo;
                    h.db.transaction(function (p) {
                      ve(
                        p,
                        h,
                        "DELETE FROM " + h.storeName + " WHERE key = ?",
                        [e],
                        function () {
                          c();
                        },
                        function (g, y) {
                          s(y);
                        },
                      );
                    });
                  })
                  .catch(s);
              });
              return (R(u, a), u);
            }
            function Qt(e) {
              var a = this,
                t = new x(function (u, c) {
                  a.ready()
                    .then(function () {
                      var s = a._dbInfo;
                      s.db.transaction(function (h) {
                        ve(
                          h,
                          s,
                          "DELETE FROM " + s.storeName,
                          [],
                          function () {
                            u();
                          },
                          function (p, g) {
                            c(g);
                          },
                        );
                      });
                    })
                    .catch(c);
                });
              return (R(t, e), t);
            }
            function Zt(e) {
              var a = this,
                t = new x(function (u, c) {
                  a.ready()
                    .then(function () {
                      var s = a._dbInfo;
                      s.db.transaction(function (h) {
                        ve(
                          h,
                          s,
                          "SELECT COUNT(key) as c FROM " + s.storeName,
                          [],
                          function (p, g) {
                            var y = g.rows.item(0).c;
                            u(y);
                          },
                          function (p, g) {
                            c(g);
                          },
                        );
                      });
                    })
                    .catch(c);
                });
              return (R(t, e), t);
            }
            function en(e, a) {
              var t = this,
                u = new x(function (c, s) {
                  t.ready()
                    .then(function () {
                      var h = t._dbInfo;
                      h.db.transaction(function (p) {
                        ve(
                          p,
                          h,
                          "SELECT key FROM " +
                            h.storeName +
                            " WHERE id = ? LIMIT 1",
                          [e + 1],
                          function (g, y) {
                            var b = y.rows.length ? y.rows.item(0).key : null;
                            c(b);
                          },
                          function (g, y) {
                            s(y);
                          },
                        );
                      });
                    })
                    .catch(s);
                });
              return (R(u, a), u);
            }
            function tn(e) {
              var a = this,
                t = new x(function (u, c) {
                  a.ready()
                    .then(function () {
                      var s = a._dbInfo;
                      s.db.transaction(function (h) {
                        ve(
                          h,
                          s,
                          "SELECT key FROM " + s.storeName,
                          [],
                          function (p, g) {
                            for (var y = [], b = 0; b < g.rows.length; b++)
                              y.push(g.rows.item(b).key);
                            u(y);
                          },
                          function (p, g) {
                            c(g);
                          },
                        );
                      });
                    })
                    .catch(c);
                });
              return (R(t, e), t);
            }
            function nn(e) {
              return new x(function (a, t) {
                e.transaction(
                  function (u) {
                    u.executeSql(
                      "SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",
                      [],
                      function (c, s) {
                        for (var h = [], p = 0; p < s.rows.length; p++)
                          h.push(s.rows.item(p).name);
                        a({
                          db: e,
                          storeNames: h,
                        });
                      },
                      function (c, s) {
                        t(s);
                      },
                    );
                  },
                  function (u) {
                    t(u);
                  },
                );
              });
            }
            function rn(e, a) {
              a = ee.apply(this, arguments);
              var t = this.config();
              ((e = (typeof e != "function" && e) || {}),
                e.name ||
                  ((e.name = e.name || t.name),
                  (e.storeName = e.storeName || t.storeName)));
              var u = this,
                c;
              return (
                e.name
                  ? (c = new x(function (s) {
                      var h;
                      (e.name === t.name
                        ? (h = u._dbInfo.db)
                        : (h = openDatabase(e.name, "", "", 0)),
                        e.storeName
                          ? s({
                              db: h,
                              storeNames: [e.storeName],
                            })
                          : s(nn(h)));
                    }).then(function (s) {
                      return new x(function (h, p) {
                        s.db.transaction(
                          function (g) {
                            function y(V) {
                              return new x(function (Y, Z) {
                                g.executeSql(
                                  "DROP TABLE IF EXISTS " + V,
                                  [],
                                  function () {
                                    Y();
                                  },
                                  function (Q, ue) {
                                    Z(ue);
                                  },
                                );
                              });
                            }
                            for (
                              var b = [], E = 0, O = s.storeNames.length;
                              E < O;
                              E++
                            )
                              b.push(y(s.storeNames[E]));
                            x.all(b)
                              .then(function () {
                                h();
                              })
                              .catch(function (V) {
                                p(V);
                              });
                          },
                          function (g) {
                            p(g);
                          },
                        );
                      });
                    }))
                  : (c = x.reject("Invalid arguments")),
                R(c, a),
                c
              );
            }
            var on = {
              _driver: "webSQLStorage",
              _initStorage: Ht,
              _support: D(),
              iterate: Kt,
              getItem: Jt,
              setItem: Xt,
              removeItem: Gt,
              clear: Qt,
              length: Zt,
              key: en,
              keys: tn,
              dropInstance: rn,
            };
            function an() {
              try {
                return (
                  typeof localStorage < "u" &&
                  "setItem" in localStorage && // in IE8 typeof localStorage.setItem === 'object'
                  !!localStorage.setItem
                );
              } catch {
                return !1;
              }
            }
            function pt(e, a) {
              var t = e.name + "/";
              return (
                e.storeName !== a.storeName && (t += e.storeName + "/"),
                t
              );
            }
            function sn() {
              var e = "_localforage_support_test";
              try {
                return (
                  localStorage.setItem(e, !0),
                  localStorage.removeItem(e),
                  !1
                );
              } catch {
                return !0;
              }
            }
            function un() {
              return !sn() || localStorage.length > 0;
            }
            function cn(e) {
              var a = this,
                t = {};
              if (e) for (var u in e) t[u] = e[u];
              return (
                (t.keyPrefix = pt(e, a._defaultConfig)),
                un()
                  ? ((a._dbInfo = t), (t.serializer = We), x.resolve())
                  : x.reject()
              );
            }
            function ln(e) {
              var a = this,
                t = a.ready().then(function () {
                  for (
                    var u = a._dbInfo.keyPrefix, c = localStorage.length - 1;
                    c >= 0;
                    c--
                  ) {
                    var s = localStorage.key(c);
                    s.indexOf(u) === 0 && localStorage.removeItem(s);
                  }
                });
              return (R(t, e), t);
            }
            function fn(e, a) {
              var t = this;
              e = W(e);
              var u = t.ready().then(function () {
                var c = t._dbInfo,
                  s = localStorage.getItem(c.keyPrefix + e);
                return (s && (s = c.serializer.deserialize(s)), s);
              });
              return (R(u, a), u);
            }
            function dn(e, a) {
              var t = this,
                u = t.ready().then(function () {
                  for (
                    var c = t._dbInfo,
                      s = c.keyPrefix,
                      h = s.length,
                      p = localStorage.length,
                      g = 1,
                      y = 0;
                    y < p;
                    y++
                  ) {
                    var b = localStorage.key(y);
                    if (b.indexOf(s) === 0) {
                      var E = localStorage.getItem(b);
                      if (
                        (E && (E = c.serializer.deserialize(E)),
                        (E = e(E, b.substring(h), g++)),
                        E !== void 0)
                      )
                        return E;
                    }
                  }
                });
              return (R(u, a), u);
            }
            function hn(e, a) {
              var t = this,
                u = t.ready().then(function () {
                  var c = t._dbInfo,
                    s;
                  try {
                    s = localStorage.key(e);
                  } catch {
                    s = null;
                  }
                  return (s && (s = s.substring(c.keyPrefix.length)), s);
                });
              return (R(u, a), u);
            }
            function vn(e) {
              var a = this,
                t = a.ready().then(function () {
                  for (
                    var u = a._dbInfo, c = localStorage.length, s = [], h = 0;
                    h < c;
                    h++
                  ) {
                    var p = localStorage.key(h);
                    p.indexOf(u.keyPrefix) === 0 &&
                      s.push(p.substring(u.keyPrefix.length));
                  }
                  return s;
                });
              return (R(t, e), t);
            }
            function pn(e) {
              var a = this,
                t = a.keys().then(function (u) {
                  return u.length;
                });
              return (R(t, e), t);
            }
            function mn(e, a) {
              var t = this;
              e = W(e);
              var u = t.ready().then(function () {
                var c = t._dbInfo;
                localStorage.removeItem(c.keyPrefix + e);
              });
              return (R(u, a), u);
            }
            function gn(e, a, t) {
              var u = this;
              e = W(e);
              var c = u.ready().then(function () {
                a === void 0 && (a = null);
                var s = a;
                return new x(function (h, p) {
                  var g = u._dbInfo;
                  g.serializer.serialize(a, function (y, b) {
                    if (b) p(b);
                    else
                      try {
                        (localStorage.setItem(g.keyPrefix + e, y), h(s));
                      } catch (E) {
                        ((E.name === "QuotaExceededError" ||
                          E.name === "NS_ERROR_DOM_QUOTA_REACHED") &&
                          p(E),
                          p(E));
                      }
                  });
                });
              });
              return (R(c, t), c);
            }
            function yn(e, a) {
              if (
                ((a = ee.apply(this, arguments)),
                (e = (typeof e != "function" && e) || {}),
                !e.name)
              ) {
                var t = this.config();
                ((e.name = e.name || t.name),
                  (e.storeName = e.storeName || t.storeName));
              }
              var u = this,
                c;
              return (
                e.name
                  ? (c = new x(function (s) {
                      e.storeName
                        ? s(pt(e, u._defaultConfig))
                        : s(e.name + "/");
                    }).then(function (s) {
                      for (var h = localStorage.length - 1; h >= 0; h--) {
                        var p = localStorage.key(h);
                        p.indexOf(s) === 0 && localStorage.removeItem(p);
                      }
                    }))
                  : (c = x.reject("Invalid arguments")),
                R(c, a),
                c
              );
            }
            var bn = {
                _driver: "localStorageWrapper",
                _initStorage: cn,
                _support: an(),
                iterate: dn,
                getItem: fn,
                setItem: gn,
                removeItem: mn,
                clear: ln,
                length: pn,
                key: hn,
                keys: vn,
                dropInstance: yn,
              },
              _n = function (a, t) {
                return (
                  a === t ||
                  (typeof a == "number" &&
                    typeof t == "number" &&
                    isNaN(a) &&
                    isNaN(t))
                );
              },
              wn = function (a, t) {
                for (var u = a.length, c = 0; c < u; ) {
                  if (_n(a[c], t)) return !0;
                  c++;
                }
                return !1;
              },
              mt =
                Array.isArray ||
                function (e) {
                  return Object.prototype.toString.call(e) === "[object Array]";
                },
              Be = {},
              gt = {},
              _e = {
                INDEXEDDB: j,
                WEBSQL: on,
                LOCALSTORAGE: bn,
              },
              Sn = [
                _e.INDEXEDDB._driver,
                _e.WEBSQL._driver,
                _e.LOCALSTORAGE._driver,
              ],
              Le = ["dropInstance"],
              qe = [
                "clear",
                "getItem",
                "iterate",
                "key",
                "keys",
                "length",
                "removeItem",
                "setItem",
              ].concat(Le),
              xn = {
                description: "",
                driver: Sn.slice(),
                name: "localforage",
                // Default DB size is _JUST UNDER_ 5MB, as it's the highest size
                // we can use without a prompt.
                size: 4980736,
                storeName: "keyvaluepairs",
                version: 1,
              };
            function In(e, a) {
              e[a] = function () {
                var t = arguments;
                return e.ready().then(function () {
                  return e[a].apply(e, t);
                });
              };
            }
            function He() {
              for (var e = 1; e < arguments.length; e++) {
                var a = arguments[e];
                if (a)
                  for (var t in a)
                    a.hasOwnProperty(t) &&
                      (mt(a[t])
                        ? (arguments[0][t] = a[t].slice())
                        : (arguments[0][t] = a[t]));
              }
              return arguments[0];
            }
            var An = (function () {
                function e(a) {
                  K(this, e);
                  for (var t in _e)
                    if (_e.hasOwnProperty(t)) {
                      var u = _e[t],
                        c = u._driver;
                      ((this[t] = c), Be[c] || this.defineDriver(u));
                    }
                  ((this._defaultConfig = He({}, xn)),
                    (this._config = He({}, this._defaultConfig, a)),
                    (this._driverSet = null),
                    (this._initDriver = null),
                    (this._ready = !1),
                    (this._dbInfo = null),
                    this._wrapLibraryMethodsWithReady(),
                    this.setDriver(this._config.driver).catch(function () {}));
                }
                return (
                  (e.prototype.config = function (t) {
                    if ((typeof t > "u" ? "undefined" : F(t)) === "object") {
                      if (this._ready)
                        return new Error(
                          "Can't call config() after localforage has been used.",
                        );
                      for (var u in t) {
                        if (
                          (u === "storeName" &&
                            (t[u] = t[u].replace(/\W/g, "_")),
                          u === "version" && typeof t[u] != "number")
                        )
                          return new Error(
                            "Database version must be a number.",
                          );
                        this._config[u] = t[u];
                      }
                      return "driver" in t && t.driver
                        ? this.setDriver(this._config.driver)
                        : !0;
                    } else
                      return typeof t == "string"
                        ? this._config[t]
                        : this._config;
                  }),
                  (e.prototype.defineDriver = function (t, u, c) {
                    var s = new x(function (h, p) {
                      try {
                        var g = t._driver,
                          y = new Error(
                            "Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver",
                          );
                        if (!t._driver) {
                          p(y);
                          return;
                        }
                        for (
                          var b = qe.concat("_initStorage"),
                            E = 0,
                            O = b.length;
                          E < O;
                          E++
                        ) {
                          var V = b[E],
                            Y = !wn(Le, V);
                          if ((Y || t[V]) && typeof t[V] != "function") {
                            p(y);
                            return;
                          }
                        }
                        var Z = function () {
                          for (
                            var Re = function (Nn) {
                                return function () {
                                  var Bn = new Error(
                                      "Method " +
                                        Nn +
                                        " is not implemented by the current driver",
                                    ),
                                    yt = x.reject(Bn);
                                  return (
                                    R(yt, arguments[arguments.length - 1]),
                                    yt
                                  );
                                };
                              },
                              Je = 0,
                              Cn = Le.length;
                            Je < Cn;
                            Je++
                          ) {
                            var Ke = Le[Je];
                            t[Ke] || (t[Ke] = Re(Ke));
                          }
                        };
                        Z();
                        var Q = function (Re) {
                          (Be[g] &&
                            console.info("Redefining LocalForage driver: " + g),
                            (Be[g] = t),
                            (gt[g] = Re),
                            h());
                        };
                        "_support" in t
                          ? t._support && typeof t._support == "function"
                            ? t._support().then(Q, p)
                            : Q(!!t._support)
                          : Q(!0);
                      } catch (ue) {
                        p(ue);
                      }
                    });
                    return (H(s, u, c), s);
                  }),
                  (e.prototype.driver = function () {
                    return this._driver || null;
                  }),
                  (e.prototype.getDriver = function (t, u, c) {
                    var s = Be[t]
                      ? x.resolve(Be[t])
                      : x.reject(new Error("Driver not found."));
                    return (H(s, u, c), s);
                  }),
                  (e.prototype.getSerializer = function (t) {
                    var u = x.resolve(We);
                    return (H(u, t), u);
                  }),
                  (e.prototype.ready = function (t) {
                    var u = this,
                      c = u._driverSet.then(function () {
                        return (
                          u._ready === null && (u._ready = u._initDriver()),
                          u._ready
                        );
                      });
                    return (H(c, t, t), c);
                  }),
                  (e.prototype.setDriver = function (t, u, c) {
                    var s = this;
                    mt(t) || (t = [t]);
                    var h = this._getSupportedDrivers(t);
                    function p() {
                      s._config.driver = s.driver();
                    }
                    function g(E) {
                      return (
                        s._extend(E),
                        p(),
                        (s._ready = s._initStorage(s._config)),
                        s._ready
                      );
                    }
                    function y(E) {
                      return function () {
                        var O = 0;
                        function V() {
                          for (; O < E.length; ) {
                            var Y = E[O];
                            return (
                              O++,
                              (s._dbInfo = null),
                              (s._ready = null),
                              s.getDriver(Y).then(g).catch(V)
                            );
                          }
                          p();
                          var Z = new Error(
                            "No available storage method found.",
                          );
                          return ((s._driverSet = x.reject(Z)), s._driverSet);
                        }
                        return V();
                      };
                    }
                    var b =
                      this._driverSet !== null
                        ? this._driverSet.catch(function () {
                            return x.resolve();
                          })
                        : x.resolve();
                    return (
                      (this._driverSet = b
                        .then(function () {
                          var E = h[0];
                          return (
                            (s._dbInfo = null),
                            (s._ready = null),
                            s.getDriver(E).then(function (O) {
                              ((s._driver = O._driver),
                                p(),
                                s._wrapLibraryMethodsWithReady(),
                                (s._initDriver = y(h)));
                            })
                          );
                        })
                        .catch(function () {
                          p();
                          var E = new Error(
                            "No available storage method found.",
                          );
                          return ((s._driverSet = x.reject(E)), s._driverSet);
                        })),
                      H(this._driverSet, u, c),
                      this._driverSet
                    );
                  }),
                  (e.prototype.supports = function (t) {
                    return !!gt[t];
                  }),
                  (e.prototype._extend = function (t) {
                    He(this, t);
                  }),
                  (e.prototype._getSupportedDrivers = function (t) {
                    for (var u = [], c = 0, s = t.length; c < s; c++) {
                      var h = t[c];
                      this.supports(h) && u.push(h);
                    }
                    return u;
                  }),
                  (e.prototype._wrapLibraryMethodsWithReady = function () {
                    for (var t = 0, u = qe.length; t < u; t++) In(this, qe[t]);
                  }),
                  (e.prototype.createInstance = function (t) {
                    return new e(t);
                  }),
                  e
                );
              })(),
              En = new An();
            B.exports = En;
          },
          { 3: 3 },
        ],
      },
      {},
      [4],
    )(4);
  });
})(Tr);
export { Pr as XdeFileUploader };
